Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Matrix visual - dynamic display

Hello: 

 

fact table columns

point name

point id

date

h1

h2

h2

 

i want a matrix withe following row

Point a sum of hours 

Point b sum of hours 

third row a measure ratio a over b 

column month: so values are monthly 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous 

 

Here is another approach:

 

First create two measures to calculate the sum hours for point a and b separately, which are similar to @bhanu_gautam 's suggestions. 

Point a = CALCULATE(SUM(FactTable[h1])+SUM(FactTable[h2])+SUM(FactTable[h3]), FactTable[point name]="point a")
Point b = CALCULATE(SUM(FactTable[h1])+SUM(FactTable[h2])+SUM(FactTable[h3]), FactTable[point name]="point b")

Then create a third measure to calculate the ratio of a to b.

Ratio a/b = DIVIDE([Point a],[Point b])

 

In the Matrix visual, place all three measures into Values field, place Month column to Column field. Then in Values section of Format pane, turn on Switch values to rows option. 

vjingzhanmsft_1-1736735245669.png

You will have a matrix similar to below one.

vjingzhanmsft_0-1736735087590.png

Hope this would be helpful. 

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous 

 

Here is another approach:

 

First create two measures to calculate the sum hours for point a and b separately, which are similar to @bhanu_gautam 's suggestions. 

Point a = CALCULATE(SUM(FactTable[h1])+SUM(FactTable[h2])+SUM(FactTable[h3]), FactTable[point name]="point a")
Point b = CALCULATE(SUM(FactTable[h1])+SUM(FactTable[h2])+SUM(FactTable[h3]), FactTable[point name]="point b")

Then create a third measure to calculate the ratio of a to b.

Ratio a/b = DIVIDE([Point a],[Point b])

 

In the Matrix visual, place all three measures into Values field, place Month column to Column field. Then in Values section of Format pane, turn on Switch values to rows option. 

vjingzhanmsft_1-1736735245669.png

You will have a matrix similar to below one.

vjingzhanmsft_0-1736735087590.png

Hope this would be helpful. 

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

bhanu_gautam
Super User
Super User

@Anonymous , You need to create a measure that sums up the hours (h1, h2, etc.) for each point. Assuming you want to sum h1 and h2, you can create a measure like this:

TotalHours = SUM('FactTable'[h1]) + SUM('FactTable'[h2])

 

Create a measure to calculate the ratio of hours between Point A and Point B. Assuming Point A has PointID = 1 and Point B has PointID = 2, you can create the following measures:

 

PointAHours = CALCULATE([TotalHours], 'FactTable'[PointID] = 1)

 

Add a new matrix visual to your report.
Drag the Date field to the columns section of the matrix to display the data by month.
Drag the Point Name field to the rows section of the matrix.
Add the TotalHours measure to the values section of the matrix.
To add the ratio, you can create a new table or use a calculated column to display the ratio in the matrix.
PointBHours = CALCULATE([TotalHours], 'FactTable'[PointID] = 2)
RatioAOverB = DIVIDE([PointAHours], [PointBHours], 0)

 

Ensure the matrix is formatted to display the data as required, with the points and their respective sums of hours, and the ratio in the third row.

 

If you need more details share sample data 




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.