March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I'm trying to create a this matrix from a table that contains the current month, previous month and the change in value and percentage.
My current data table looks like this...
YearMonth | MonthName | Product | Total | CurrentMonth | PreviousMonth |
202112 | December | APPLES | 688 | NO | YES |
202201 | January | APPLES | 856 | YES | NO |
202112 | December | ORANGES | 5 | NO | YES |
202112 | December | PEARS | 75 | NO | YES |
202201 | January | PEARS | 88 | YES | NO |
202112 | December | KIWIFRUIT | 35 | NO | YES |
202201 | January | KIWIFRUIT | 40 | YES | NO |
202112 | December | BANANAS | 72 | NO | YES |
202201 | January | BANANAS | 27 | YES | NO |
202112 | December | STRAWBERRIES | 113 | NO | YES |
202201 | January | STRAWBERRIES | 87 | YES | NO |
202112 | December | BLUEBERRIES | 36 | NO | YES |
202201 | January | BLUEBERRIES | 38 | YES | NO |
202112 | December | WATERMELON | 7 | NO | YES |
202201 | January | WATERMELON | 7 | YES | NO |
202112 | December | PINEAPPLE | 13 | NO | YES |
202112 | December | PINEAPPLE | 10 | YES | NO |
202112 | December | CHERRIES | 1 | NO | YES |
202112 | December | ROCKMELON | 16 | NO | YES |
202112 | December | GRAPES | 2 | NO | YES |
This is how I would like the matrix to look...
Product | This Month | Last Month | Change | Change % |
APPLES | 856 | 688 | 168 | 24.4% |
ORANGES | 0 | 5 | -5 | -100.0% |
PEARS | 88 | 75 | 13 | 17.3% |
KIWIFRUIT | 40 | 35 | 5 | 14.3% |
BANANAS | 27 | 72 | -45 | -62.5% |
STRAWBERRIES | 87 | 113 | -26 | -23.0% |
BLUEBERRIES | 38 | 36 | 2 | 5.6% |
WATERMELON | 7 | 7 | 0 | 0.0% |
PINEAPPLE | 10 | 13 | -3 | -23.1% |
CHERRIES | 0 | 1 | -1 | -100.0% |
ROCKMELON | 0 | 16 | -16 | -100.0% |
GRAPES | 0 | 2 | -2 | -100.0% |
I've tried so many ways to do this but I just can't make it work.
Can someone please help me with how to do this?
Many thanks
darls15
Solved! Go to Solution.
I would recommend you lose the "Current Month" and "Previous Month" columns - you don't want to box yourself in with that. Either use measures to figure out the max month, or use a slicer.
See attached for a sample implementation.
Thank you lbendlin, I appreciate your advice re current/previous months. This is exactly what I needed and it's very much appreciated 🙂
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |