0 votes
1 view
in BI by (17.6k points)

Let's say I have a table like this - [Orders]

Date        Amount  Category

12/12/2017  100      A

12/12/2017  200      B

12/12/2017  300      C

1/1/2018    400      A

1/1/2018    500      B

And I have a slicer for Category.

If only one single Value is selected, then a measure like this will work 

 CALCULATE(SUM(Orders[Amount]),FILTER(ALL(Orders), Orders[Category] = SelectedValue(Category))).

When more than one value is selected, how would you pass that inside the DAX Measure? 

1 Answer

0 votes
by (47.2k points)
  • Use this:

= CALCULATE(SUM(Orders[Amount]) FILTER(ALL(Orders), Orders[Category] IN VALUES(Category)))

  • In most situations, you should just be able to write SUM(Orders[Amount]) and Power BI will automatically do the filtering for you based on the slicer

Related questions

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...