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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
RudyL
Helper I
Helper I

Calculated functions and context

I think I need some help with the calculate function here. Please look at the photo below. I have 3 rooms in 2 floors that have a certain capacity (column C). Now for every part of the day for one week a sensor collects data on real use (column F). 

My question is how to calculate the measures that return the percentage of time the rooms on a certain floor have been used more than 60% (cells K11 and K12). 

Row contexts and filter contexts are killing me here. Advice would be appreciated. Columns G and H are easy to construct in PowerBI, but what's the next step to get to the end result?

 

OccupationExcersise - Excel.png

2 REPLIES 2
kentyler
Solution Sage
Solution Sage

Do you want to get this percent for mornings, and also for afternoons. Or do you want to combine the use for morning and afternoon as usage for the day ?





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Hi Kentyler, i'll try to clarify. Morning and afternoon are separate timeframes. I have a dimtable with 10 timeframes ranging from monday morning to friday afternoon. See image in original post: I calculate occupation per room per timeframe (G =F/C). After that I mark all lines 1 that have an occupation over 60% in column H. This is the first easy set of steps.

Now the question I would like to answer is what is the percentage of all timeframes per floor that are marked with an occupation over 60%. example: floor 1 has 2 rooms x 10 timeframes = 20 lines of which 9 are marked as 1 in column H. That would be 45%. The same goes for floor 2: it has 1 room x 10 timeframes of which only 2 are marked as 1 in column H. That is 20%.

 

It's the context needed for making the calculation of column G that i'm losing when i try to aggregate to floor level that I need help with.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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