The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello,
I am looking to calculate the numerical difference (in one column) and % difference (another column) between the last two dates for each row: 31st July and 17th August.
The values in this table are from one measure which is linked to a FX conversion table (below is the screenshot measure), filtered by date and Financial Partner.
Thank you.
Solved! Go to Solution.
@Anonymous , With help from the date table, you can use this month vs last month, I am assuming you are getting 17 -Aug because that is the last date in August you have data
example
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
You can also explore lastnonblankvalue, along with MTD
https://www.linkedin.com/pulse/five-recent-power-bi-functions-you-should-use-more-often-amit-chandak
Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA
Hi, @Anonymous ;
You could create a measure.
Measure =
var _second=CALCULATE(MAX('Table'[date]),FILTER('Table',[date]<MAX('Table'[date])))
return
IF(HASONEVALUE('Table'[date]),[Total in gdp],
CALCULATE([Total in gdp],FILTER('Table',[date]=MAX('Table'[date])))-CALCULATE([Total in gdp],FILTER('Table',[date]=_second)))
The final show:
If the above one can't help you get the desired result, It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , With help from the date table, you can use this month vs last month, I am assuming you are getting 17 -Aug because that is the last date in August you have data
example
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
You can also explore lastnonblankvalue, along with MTD
https://www.linkedin.com/pulse/five-recent-power-bi-functions-you-should-use-more-often-amit-chandak
Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
114 | |
78 | |
77 | |
47 | |
38 |
User | Count |
---|---|
147 | |
115 | |
65 | |
64 | |
53 |