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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Sana-Shaikh
Frequent Visitor

Power BI Matrix Per Hour Overview

I have 2 matrices I need to create:
1. Matrix showing Utilization % per Ride per weekday
2. Matrix showing Total Utilization % per hour per weeekday

The ride data is in the Ridership Events table and the Capacity data is in the Ride table.

I created a calculation for the first Matrix and it works with the data:

 


The problem I am having is with the second Matrix per hour. When I click on the first matrix for a specific ride, then the second matrix changes accordingly to the correct values per hour when it was 

Util% = DIVIDE(SUM('RidershipEvents'[CumulativeRiders]), SUM('Ride'[Capacity]), 0)

utilized.

The problem lies in the overview of the second Matrix. When I open the Power BI file with no filters placed, the data is showing percentages well over 100%. I believe the Matrix is calculating the total percentages per hour, for example: (50% + 30% + 80% = 160%)

Instead, it should be calculating (Total Cumulative Riders/ Total Capacity), for example: (350/400 = 87.5%

 

 

 

Screenshot 2024-06-24 131105.png

 

 

 

I think the second matrix needs a different DAX calculation for Utilization % that takes total riders per hour and divides total possible riders per hour.

Can anyone help with this issue?

2 ACCEPTED SOLUTIONS
v-yilong-msft
Community Support
Community Support

Hi @Sana-Shaikh ,

I think you can use the VAR function to write the variables one by one, here is the DAX code you can try.

Total Utilization % =
VAR TotalRidersPerHour =
    SUM ( 'RidershipEvents'[CumulativeRiders] )
VAR TotalCapacityPerHour =
    SUM ( 'Ride'[Capacity] )
RETURN
    DIVIDE ( TotalRidersPerHour, TotalCapacityPerHour, 0 )

If this code doesn't work you can provide me more information or your .pbix file.

 

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi @Sana-Shaikh ,

I think I'm missing your point probably because I don't have a complete view of the data in your table. If you can provide me with specific data from the table, I will look into your question further.

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Sana-Shaikh
Frequent Visitor

No, This gives me the same percentage error. I think time needs to be added in the DAX calculation. The formula is counting every percentage instead of every cumulative rider divided by total capacity

Hi @Sana-Shaikh ,

I think I'm missing your point probably because I don't have a complete view of the data in your table. If you can provide me with specific data from the table, I will look into your question further.

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-yilong-msft
Community Support
Community Support

Hi @Sana-Shaikh ,

I think you can use the VAR function to write the variables one by one, here is the DAX code you can try.

Total Utilization % =
VAR TotalRidersPerHour =
    SUM ( 'RidershipEvents'[CumulativeRiders] )
VAR TotalCapacityPerHour =
    SUM ( 'Ride'[Capacity] )
RETURN
    DIVIDE ( TotalRidersPerHour, TotalCapacityPerHour, 0 )

If this code doesn't work you can provide me more information or your .pbix file.

 

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.