The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I need a measure that will return the difference between yesterday's max and todays max
so this is my input:
table name: netusage
output example:
18.11.2020 no data - i dont care
19.11.2020 10300-10166 = 134
20.11.2020 10713-10300 = 413
tried something like that:
todays_maximum =
CALCULATE(
MAX(netusage[Traffic]),
netusage[Date] = TODAY()
)
ysterdayss_maximum =
CALCULATE(
MAX(netusage[Traffic]),
netusage[Date] = TODAY()-1
)
Solved! Go to Solution.
sorry, I didn't consider the time part. That will affect the result. I create a new date column and slightly change the DAX.
please see the attachment
Proud to be a Super User!
you can try to create a measure
Measure =
VAR yesterday=maxx(FILTER(all(netusage),'netusage'[Date]=SELECTEDVALUE('netusage'[Date])-1),netusage[Traffic])
return if(ISBLANK(yesterday),BLANK(),max(netusage[Traffic])-yesterday)
Proud to be a Super User!
Thanks for the quick reply, I just tried it but the measure doesn't return any value, maybe I'm doing something wrong.
sorry, I didn't consider the time part. That will affect the result. I create a new date column and slightly change the DAX.
please see the attachment
Proud to be a Super User!
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
78 | |
68 | |
52 | |
50 |
User | Count |
---|---|
120 | |
120 | |
76 | |
62 | |
61 |