Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have a slicer that the enduser can select multiple years with. I have a Matrix that shows the values by month for the year that the were selected from the slicer.
How can I calculate the difference in a new measure in the matrix between the min selected yearly monthly value VS the MAX selected yearly montly value in the Matrix table?
I would like to subtract the top Month-Year coulmn from the bottom Month-Year. then put that result in bottom total group if possible. And if the user clicks the later year before the earlier year or three years that's ok it's his problem.
@MikeChicago,
What is the current status of your issue? Could you please post expected result based on the sample data in your Matrix?
Regards,
Lydia
Year Difference = Datediff(MIN(Table1[Date]), Max(Table1[Date]), Year) + 1
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.
No I think I need DAX code that looks at the Matrix visual -> Finds the min/max year then claculates the difference between each month in the matrix. It possible some one could clikc 2017, 2012, 2016, 2015 so it would calculate the difference between 2017 and 2012 per month.
Year January Febuary
2017 20.00 10.00
2012 5.00 1.00
2016 18.00 8.00
2015 15.00 6.00
Diff 15.00 9.00
Do you have calendar table in data model?
Try this:
Diff Year = var minDate = Calculate(Min(Table[Date]), AllSelected(Table[Date])) var maxDate= Calculate(Max(Table[Date]), AllSelected(Table[Date])) return Datediff(minDate, maxDate, year)+1
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
96 | |
95 | |
83 | |
70 | |
66 |
User | Count |
---|---|
118 | |
106 | |
93 | |
79 | |
72 |