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 have the below Dataset. And I need both measure and calculated column which calculates the difference as in the below example. I am having problems with the cases when there is gap between dates. Please help.
Date; ID Amount Difference(!)
02/01/01 1 100 100
06/01/01 2 5 5
08/01/01 1 150 50
09/01/01 2 1500 1450
16/01/99 1 151 1
Thank you
Solved! Go to Solution.
I was able to find a solution.
Column =
I was able to find a solution.
Column =
Hi @Anonymous ,
To create a measure as below.
difference = VAR a = MAX ( 'Table'[date] ) VAR d = CALCULATE ( MAX ( 'Table'[date] ), FILTER ( ALL ( 'Table' ), 'Table'[date] < a ), VALUES ( 'Table'[id] ) ) VAR c = CALCULATE ( SUM ( 'Table'[amount] ), FILTER ( ALL ( 'Table' ), 'Table'[date] = d ), VALUES ( 'Table'[id] ) ) RETURN SUM ( 'Table'[amount] ) - c
@Anonymous How is difference calculated?
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 |
---|---|
112 | |
97 | |
85 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |