We're giving away 30 tickets for FREE! Share your story, your vision, or your hustle and tell us why YOU deserve a ticket.
Apply nowWin a FREE 3 Day Ticket to FabCon Vienna. Apply now
Hello,
What DAX measure (or column) would be required if I wanted to count the difference in values within a column of a fact table - per year?
Below the subtract of 8 (2021) from 5 (2010) gives me 3.
Kudos to who can help.
Thank!
Solved! Go to Solution.
Hi,
Please check the below picture and the attached pbix file.
It is for creating a measure.
Diff: =
VAR _previousvalue =
CALCULATE (
[Total coffees:],
OFFSET ( -1, ALL ( Data[Year] ), ORDERBY ( Data[Year], ASC ) )
)
RETURN
IF (
NOT ISBLANK ( _previousvalue ) && HASONEVALUE ( Data[Year] ),
[Total coffees:] - _previousvalue
)
Fantastic!
Hi,
Please check the below picture and the attached pbix file.
It is for creating a measure.
Diff: =
VAR _previousvalue =
CALCULATE (
[Total coffees:],
OFFSET ( -1, ALL ( Data[Year] ), ORDERBY ( Data[Year], ASC ) )
)
RETURN
IF (
NOT ISBLANK ( _previousvalue ) && HASONEVALUE ( Data[Year] ),
[Total coffees:] - _previousvalue
)
User | Count |
---|---|
13 | |
12 | |
8 | |
8 | |
6 |
User | Count |
---|---|
28 | |
19 | |
13 | |
11 | |
7 |