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.
Date Score
01/01/2019 3
01/02/2019 5
01/03/2019 1
01/04/2019 2
01/05/2019 3
01/06/2019 4
Hi @markhomer ,
DAX does not allow to create a difference based on 'previous value'. You can however create a difference as long as you have a rule for what the previous value should value.
If the previous value is the previous day, you can use the following formula:
Diff with previous day = SUM('Table'[Score])- CALCULATE(SUM('Table'[Score]) , PREVIOUSDAY('Table'[Date].[Date]))
Here is the result:
Let me know if this is what you're looking for.
Regards,
LC
Interested in Power BI finance templates? Check out my blog at www.finance-bi.com
Thanks LC,
I am hoping it is possible to create a measure that gives me the percentage difference between the last 2 entries.
Is it possible to have some kind 'Max date -1' expression? or maybe 'allexcept' the max date?
Thanks,
Mark
Hi @markhomer ,
Yes you can do a MAX to find the last day! Here is the updated formula.
Let me know if it works for you,
LC
Difference of last 2 days = VAR lastday = MAX('Table'[Date]) VAR beforeLastDay = lastday-1 RETURN CALCULATE( SUM('Table'[Score]) , 'Table'[Date] = lastday ) - CALCULATE( SUM('Table'[Score]) , 'Table'[Date] = beforeLastDay )
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 |
---|---|
102 | |
101 | |
78 | |
70 | |
63 |
User | Count |
---|---|
141 | |
106 | |
101 | |
85 | |
72 |