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.
Hello
I need to calculate the daily percentage variation of Covid19 cases. I have the measures of daily cases and cumulative cases. How can I calculate the percentage variation of each day, of those two measures?
Thanks for the help.
Solved! Go to Solution.
You can use a variable to calculate the previous days value for your measure and show the % change like so:
Cases % change from prior day =
VAR _pd = CALCULATE ( [Confirmed Cases], DATEADD('cases'[Date],-1,DAY) )
RETURN
DIVIDE([Confirmed Cases],_pd)-1
If you don't you get the ratio rather than the growth.
Take 11 vs 10
11/10 = 110%
110% - 1 = 10% growth
You can use a variable to calculate the previous days value for your measure and show the % change like so:
Cases % change from prior day =
VAR _pd = CALCULATE ( [Confirmed Cases], DATEADD('cases'[Date],-1,DAY) )
RETURN
DIVIDE([Confirmed Cases],_pd)-1
@jdbuchanan71Hi. Why do we add -1 after the Divide function between the confirmed_cases and the variable?
If you don't you get the ratio rather than the growth.
Take 11 vs 10
11/10 = 110%
110% - 1 = 10% growth
Great, that's how it was, thank you.
Do you know now how can I get the case growth factor out? Here's how I have the model now:
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 |
---|---|
96 | |
93 | |
83 | |
70 | |
65 |
User | Count |
---|---|
118 | |
106 | |
93 | |
79 | |
72 |