Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi!
I'd like to know how to do something like this in a matrix visual:
I have a fact table with components sold, and a calculated column that tells you the month it has been sold.
I've tried to add a calculated column to put the month period, but it doesn't work, as it only lets me go to another level of hierarchy.
Thanks!
Solved! Go to Solution.
Hi @Woncarc ,
Please refer below sample data snap.
I have created some measures and placed in value fields.
Please refer sample output snap.
Please find the attached snaps and sample Pbix file for your reference.
If my response has resolved your query, please mark it as the "Accepted Solution" to assist others. Additionally, a "Kudos" would be appreciated if you found my response helpful.
Thank you
Hi @Woncarc ,
If my response has resolved your query, please mark it as the "Accepted Solution" to assist others. Additionally, a "Kudos" would be appreciated if you found my response helpful.
Thank you
Hi @Woncarc ,
Thank you for reaching out to the Microsoft Community Forum.
Please follow below steps.
1. I took sample data as Sales table ( Component, Monthsold,Quantity columns).
2. I have created "Month Group" calculated column for Sales Table.
MonthGroup =
SWITCH(
TRUE(),
Sales[MonthSold] <= 3, "1 to 3",
Sales[MonthSold] <= 6, "4 to 6",
Sales[MonthSold] <= 9, "7 to 9",
"10 to 12"
)
3. Created "Total Quantity" calculated column .
Total Quantity = SUM(Sales[Quantity])
4. Created "Cumulative Quantity" calculated measure .
Cumulative Quantity =
CALCULATE(
[Total Quantity],
FILTER(
ALL(Sales[MonthSold]),
Sales[MonthSold] <= MAX(Sales[MonthSold])
)
)
5. Placed "Component" field in Rows, "MonthGroup" in column and "TotalQuantity" in values
Please find below snaps of sample data and sample output.
If my response has resolved your query, please mark it as the "Accepted Solution" to assist others. Additionally, a "Kudos" would be appreciated if you found my response helpful.
Thank you
Hi @Woncarc ,
If my response has resolved your query, please mark it as the "Accepted Solution" to assist others. Additionally, a "Kudos" would be appreciated if you found my response helpful.
Thank you
Hi.
Thanks for the solution, but I'd like to also get the individual months on the matrix visual.
For example, in your viz it should appear
1 2 3 1 to 3
C1 9 25 29 63
C2 0 1 2 3
Hi @Woncarc ,
Please refer below sample data snap.
I have created some measures and placed in value fields.
Please refer sample output snap.
Please find the attached snaps and sample Pbix file for your reference.
If my response has resolved your query, please mark it as the "Accepted Solution" to assist others. Additionally, a "Kudos" would be appreciated if you found my response helpful.
Thank you
Hi @Woncarc ,
If my response has resolved your query, please mark it as the "Accepted Solution" to assist others. Additionally, a "Kudos" would be appreciated if you found my response helpful.
Thank you
Hi @Woncarc ,
If my response has resolved your query, please mark it as the "Accepted Solution" to assist others. Additionally, a "Kudos" would be appreciated if you found my response helpful.
Thank you
Hello,
My recommendation would be to consider using a Date Dimension table and connect it to your fact table. Within this date dim I would recommend defining your periods (e.g. Months January through March are equal to period Q1).
From there you can create an easy matrix to where your components sold easily roll up per period they are sold. This is all assuming you have a date column in your fact table.
This is what would be best practice for Power BI, but if for some reason you have limitations within your data set to where you are unable to do this, you can consider adding a calculated column for each period along the following lines:
Calculated Col 1 to 3 =
Table[col1] + Table[col2] + Table[col3]
Repeat for each period. Again, not best practice, but it should get you what you need.
Proud to be a Super User! | |
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
76 | |
73 | |
42 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
43 |