Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
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

0 votes
1 answer
asked Nov 30, 2020 in BI by Chris (11.1k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...