Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
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
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 🙂
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.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 18 |
| User | Count |
|---|---|
| 68 | |
| 67 | |
| 33 | |
| 31 | |
| 29 |