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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
anonymoususer92
Frequent Visitor

Dividing a Measure by a Column

Hi All,

 

Here is my situation - 

We are trying to calculate our building utilization by comparing how many people are returning to work and what was the original building assignment of these employees. Since we're entering a hybrid work model, this report will help us understand which buildings are being under/over utilizied. 

I have data coming in from 2 tables - 

 

BadgingTable : Contains information of all the people coming into work. Which building are they badging into, at what time, etc.

Example:

EmpID     EnterBuildingNo  EnterBadgeDate   

1                      A                  4/10/2022 

2                      B                  4/10/2022 

3                      A                  4/10/2022 

4                      C                  4/10/2022 

5                      A                  4/10/2022 

1                      C                  4/11/2022 

3                      C                  4/11/2022

4                      B                  4/11/2022 

9                      A                  4/11/2022 

1                      A                  4/12/2022 

2                      A                  4/12/2022 

4                      A                  4/12/2022 

9                      B                  4/12/2022 

12                    C                  4/12/2022 

 

Occupancy Table:

BuildingNo   AssignedSpaces

A                             10

B                              8

C                              7

The two tables are linked by the EnterBuildingNo/BuildingNo. 

I want to find out the Utilization % as a measure by Building and Date. Since it'll be a matrix with dates as columns and building numbers by rows, I can have either an average utilization or a daily utilization %

From the above example - 

Date              BuildingNo      Utilization%

4/10/2022            A                      30%

4/10/2022            B                      12.5%

4/10/2022            C                      14.3%

4/11/2022            A                      10%

4/11/2022            B                      12.5%

4/11/2022            C                      28.6%

4/12/2022            A                      30%

4/12/2022            B                      12.5%

4/12/2022            C                      14.3%

 

Any advice is greatly appreciated! 

 

Thank you

 

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You could try creating a measure like

Utilization = DIVIDE( COUNTROWS( 'Badging Table'), SELECTEDVALUE( 'Occupancy Table'[Assigned Spaces]) )

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

You could try creating a measure like

Utilization = DIVIDE( COUNTROWS( 'Badging Table'), SELECTEDVALUE( 'Occupancy Table'[Assigned Spaces]) )

Thank you so much @johnt75 ! This works perfectly 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.