Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Year T otal Sales Difference in Sales from Last Year (should be result)
2014 0
2015 2.5 2.5
2016 4.5 2
2017 9 4.5
2018 0 -9
2019 2 2
How do you write dax for it?
Solved! Go to Solution.
Hi @jiglow3501,
Please create the calculated column with the formula below.
Column =
VAR temp =
CALCULATE (
MAX ( 'table'[Total Sales] ),
FILTER ( 'table', 'table'[Year] = EARLIER ( 'table'[Year] ) - 1 )
)
RETURN
IF ( 'Table'[Total sales] - temp = 0, BLANK (), 'Table'[Total sales] - temp )
Then you will get the output below.
Best Regards,
Cherry
Hi @jiglow3501,
Please create the calculated column with the formula below.
Column =
VAR temp =
CALCULATE (
MAX ( 'table'[Total Sales] ),
FILTER ( 'table', 'table'[Year] = EARLIER ( 'table'[Year] ) - 1 )
)
RETURN
IF ( 'Table'[Total sales] - temp = 0, BLANK (), 'Table'[Total sales] - temp )
Then you will get the output below.
Best Regards,
Cherry
Hi @v-piga-msft
I am working with a table with daily quantities.
What would be the formula for a calculated column with the daily difference of the quantities?
e.g.
Date Qty Diff
6/1/2020 1
6/2/2020 2 1
Thank you!
Daniel
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 50 | |
| 40 | |
| 37 | |
| 14 | |
| 14 |
| User | Count |
|---|---|
| 85 | |
| 69 | |
| 38 | |
| 29 | |
| 27 |