Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi,
I have a matrix table showing data for each month.
Can you please advise what is the formula to calculate difference between last month vs first month.
For example: 14-49 = -35
Thank you in advance!
Solved! Go to Solution.
Hi @wy_khoo ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(2) We can create a measure.
Measure =
var _first_date=CALCULATE(MIN('Table'[date]),ALLSELECTED('Table'))
var _first_value=CALCULATE(SUM('Table'[value]),FILTER(ALLSELECTED('Table'),MONTH('Table'[date])=MONTH(_first_date) && YEAR('Table'[date])=YEAR(_first_date)))
var _value=CALCULATE(SUM('Table'[value]),FILTER(ALLSELECTED('Table'),YEAR('Table'[date])=YEAR(MAX('Table'[date])) && MONTH('Table'[date])=MONTH(MAX('Table'[date]))))
RETURN _value-_first_value
(3) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @wy_khoo ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(2) We can create a measure.
Measure =
var _first_date=CALCULATE(MIN('Table'[date]),ALLSELECTED('Table'))
var _first_value=CALCULATE(SUM('Table'[value]),FILTER(ALLSELECTED('Table'),MONTH('Table'[date])=MONTH(_first_date) && YEAR('Table'[date])=YEAR(_first_date)))
var _value=CALCULATE(SUM('Table'[value]),FILTER(ALLSELECTED('Table'),YEAR('Table'[date])=YEAR(MAX('Table'[date])) && MONTH('Table'[date])=MONTH(MAX('Table'[date]))))
RETURN _value-_first_value
(3) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous , thank you for your solution. It works!
Hi @wy_khoo
Please refer to the linked tutorial:
https://www.youtube.com/watch?v=cAxoxvnN_vQ
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 84 | |
| 49 | |
| 38 | |
| 31 | |
| 30 |