Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi guys,
Can someone help me with the following:
I need to create 5 more columns which respectively will be the difference between 2020 and 2019.
I'm quite sure I'll need some kind of custom measure for it, just don't know which.
Thank you in advance.
Solved! Go to Solution.
@Anonymous assuming you have date dimension in your model, if yes, good, otherwise add one and then add following measure:
Difference from PY =
VAR __prevYear = CALCULATE ( SUM ( Table[Sales] ), PREVIOUSYEAR ( DateTable[Date] ) )
RETURN
SUM ( Table[Sales] ) - __prevYear
if you already have a measure, then use that instead of SUM ( Table[Sales] )
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi @Anonymous,
I think you can create a calculation table with all column category that you used on the snapshot.
Then you can use it on the column fields of the matrix and write a measure with switch function to check current row content and category to return special expression results.
Regards,
Xiaoxin Sheng
@Anonymous assuming you have date dimension in your model, if yes, good, otherwise add one and then add following measure:
Difference from PY =
VAR __prevYear = CALCULATE ( SUM ( Table[Sales] ), PREVIOUSYEAR ( DateTable[Date] ) )
RETURN
SUM ( Table[Sales] ) - __prevYear
if you already have a measure, then use that instead of SUM ( Table[Sales] )
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
85 | |
79 | |
53 | |
38 | |
36 |
User | Count |
---|---|
100 | |
85 | |
47 | |
45 | |
44 |