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

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

Reply
muncs
New Member

Divide values from two tables, dynamic required

Hi there,
 
I've got a desk booking app and I'm trying to create the occupancy percentage, I want to do this by counting the number of desks at each site, in the Desks_MasterData table, then divide it by the number of bookings in the Bookings table for each site. Then I want the user to use the slicer filters to filter bookings for that day to get %.
 
I've got it to work but only on Static formuals so the filter doesn't chage.
 
These are the formula's I'm currently working with but they return a 0 result when combined together. When I see the values seperatly they are correct.
 
VAR DesksCount = COUNTROWS(FILTER(Desks_MaterData,Desks_MaterData[D_SiteConcat]=Bookings[SiteConcat]))
VAR BookingsCount = COUNT(Bookings[DateOfBooking])

 

Occ% =
DIVIDE(COUNTROWS(FILTER(Desks_MaterData,Desks_MaterData[D_SiteConcat]=Bookings[SiteConcat])),COUNT(Bookings[DateOfBooking]))
 
Any pointers or assistance on where I'm going wrong would be apprecaited.

 

1 REPLY 1
PC2790
Community Champion
Community Champion

Hello,

 

Can you try:

VAR BookingsCount = CALCULATE(COUNT(Bookings[DateOfBooking]),ALL(Bookings))

 

And then OCC% = DIVIDE([DesksCount],[BookingsCount])

 

As you are trying to get the percentage so the denominator should not be affected by any filters.

 

I hope this works for you

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.