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
Hello All,
How to get the difference between two weeks, below is the example
Try this solution. In this example, the data table is WeekDiff.
Create calculated table:
WeekDiffDates = VALUES ( WeekDiff[Date] )
Create a relationship between WeekDiffDates and WeekDiff.
Create measures:
Count of Country = COUNT ( WeekDiff[Country] )
Difference =
VAR vDate =
MAX ( WeekDiffDates[Date] )
VAR vCurrentCount = [Count of Country]
VAR vPrevDate =
CALCULATE ( MAX ( WeekDiffDates[Date] ), WeekDiffDates[Date] < vDate )
VAR vPrevCount =
CALCULATE ( [Count of Country], WeekDiffDates[Date] = vPrevDate )
VAR vResult = vPrevCount - vCurrentCount
RETURN
vResult
In the matrix, columns should be WeekDiffDates[Date]:
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.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
18 | |
18 | |
17 | |
15 | |
13 |
User | Count |
---|---|
36 | |
35 | |
19 | |
18 | |
18 |