DAX - filter based on measure results

sassaboss

New Member
Joined
Oct 8, 2020
Messages
9
Office Version
  1. 2016
Platform
  1. Windows
Hello,
I wish to calculate percent of change from month to month and to automatically return values only with fulfilled conditions.
Can I do all that using just DAX.
My thinking is something like this.
I have May and April for example. And columns with Date, Product_Name and Product_Sales.
Tot_SUM := sum(Table[Product_Sales])
SUM_PrMonth := CALCULATE( [Tot_SUM] ; PREVIOUSMONTH( Table[Date] ))
Percent_Change := Tot_SUM / SUM_PrMonth - 1

And in slicer I will choose month. Now, I want to show in table in Power BI only rows with product names where Percent of change is less than -20% and greater than 20%.
I tried with a given formula but unfortunately not very successful.
Measure := CALCULATE( [Tot_SUM]; FILTER( Table; [Percent_Change] < 0,2 && [Percent_Change] > 0,2 ))

Thanks in advance :)
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Well, you can do it easily using the filter pane on the right of the report canvas. Just drag the measure as a new filter (on the visual, or the page) and set the filter as you please.

if you want to use DAX, you need to fix your code

Measure := CALCULATE( [Tot_SUM]; FILTER( Table; [Percent_Change] < -0,2 || [Percent_Change] > 0,2 ))
 
Upvote 0
Well, you can do it easily using the filter pane on the right of the report canvas. Just drag the measure as a new filter (on the visual, or the page) and set the filter as you please.

if you want to use DAX, you need to fix your code

Measure := CALCULATE( [Tot_SUM]; FILTER( Table; [Percent_Change] < -0,2 || [Percent_Change] > 0,2 ))
Great :)
I just realised that I used && and had a lot of problems. Thanks.
I will try to do that will filter pane also.

Many thanks for the answer.
 
Upvote 0

Forum statistics

Threads
1,214,944
Messages
6,122,392
Members
449,081
Latest member
JAMES KECULAH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top