Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Good day,
I trust this message finds you well.
Please note I have created the measure as per your script however on my side the % is incorrect.
Please see screenshot below Previous day figure is 3 542, current day is 3 940. therefore (3 940-3 542)/ 3 542 = 11% however I am getting -0.99.
Please assist....Im not understanding why I am getting the incorrect figure. Thanks
Solved! Go to Solution.
@Anonymous , Try measure like this with date table joined iwth transaction date
This Day = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])))
Last Day = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])-1))
or
Last Day = CALCULATE(sum('order'[Qty]), previousday('Date'[Date]))
diff =[This Day] - [Last Day]
diff% =Divide([This Day] - [Last Day],[Last Day])
@Anonymous , Try measure like this with date table joined iwth transaction date
This Day = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])))
Last Day = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])-1))
or
Last Day = CALCULATE(sum('order'[Qty]), previousday('Date'[Date]))
diff =[This Day] - [Last Day]
diff% =Divide([This Day] - [Last Day],[Last Day])
Hi @amitchandak
Thank you for the above calculation...it works perfectly :). Just a quick question...how do I make one for the Previous months last and and previous day. I appreciate your assistance.
Thanks Amitchankdak the calculation works. Just a quick question how would I then create the calculation to be dynamic? by that I mean currently the calculation works when my rows are a date field...how do I get it to work if my row is maybe a location? eg: Previous Day Sales and Current Day sales per Location, Client, Sales rep?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
96 | |
77 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |