Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi All,
It's me again, just need some help in getting the difference between 2 month columns in my report using Matrix visualization
The months are automatically filtered using Last 2 Calendar Months
Thanks as always!
Solved! Go to Solution.
In this case, you would need a minimum of three measures. I'm assuming you already have two measures created. I am hoping my assumption is correct. If not you'll need to create those measures.
1 for the sum of the last 2 months
1 for the sum of the last 1 month
You would then take the sum of both and subtract the other. In your case the formula would be..
Delta := [Last1Month] - [Last2Month]
Hi @mangchaaBI ,
I think you'd better use a table visual.
This is my test table:
Please try following DAX to create three new columns:
Last 2 month_August = CALCULATE(SUM('Table'[Value]),FILTER('Table',MONTH('Table'[Date])=8 && 'Table'[ItemName]=EARLIER('Table'[ItemName])))
Last 1 month_September = CALCULATE(SUM('Table'[Value]),FILTER('Table',MONTH('Table'[Date])=9 && 'Table'[ItemName]=EARLIER('Table'[ItemName])))
Difference = [Last 1 month_September] - [Last 2 month_August]
Create a table visual:
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
And what if I need the years to be dynamically selected by the user instead of manually input?
In this case, you would need a minimum of three measures. I'm assuming you already have two measures created. I am hoping my assumption is correct. If not you'll need to create those measures.
1 for the sum of the last 2 months
1 for the sum of the last 1 month
You would then take the sum of both and subtract the other. In your case the formula would be..
Delta := [Last1Month] - [Last2Month]
Hi @hnguy71 I don't have the measures created yet, but I think I'm getting your instructions, can take it from here, thanks!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 48 | |
| 40 | |
| 39 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 70 | |
| 67 | |
| 32 | |
| 27 | |
| 25 |