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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Need help calculating totals and weekly percentages for groups.

Hi all,

 

I need help with some measures please. I'm creating a report that shows the number of available appointments and room capacity utilisation %, based on data from booking system.

 

I have created a table visual in my report as shown below. Please note in the table there is a row for each room per day of the current week (for example 11-17 Jan). 

 

Room (from data table)Date (from data table)Daily appointments available (measure)Daily Capacity Utilised (%) (measure)
London ROOM 111 Jan303.23
London ROOM 211 Jan2519.35
Brighton ROOM 111 Jan2116
Brighton ROOM 211 Jan2212
Birmingham Room 111 Jan55%
Birmingham Room 211 Jan1010%
Birmingham Room 311 Jan1515%
London ROOM 112 Jan303.23

 

I want to create a second visual table, as shown below, that calculates the total available appointments for the week, in addition to the total weekly capacity utilised %, per Room Location (so I grouped the rooms)

 

Room LocationTotal Appointments available this weekWeekly Capacity Utilised (%)
London  
Brighton  
Birmingham  

 

I need help with the measures for this please. 

 

Please note the London room is open 7 days a week, Brighton 6 days, and Birmingham 5 days.

 

Thanks.

3 REPLIES 3
v-easonf-msft
Community Support
Community Support

Hi, @Anonymous 
Please show your relevant measures' formulas.

If possible , can you upload a sample pbix to OneDrive and  share the link here  for test?


You can take a try formula as below:

Measure2_Daily appointments available = sumx('Table',[Measure_Daily appointments available])

 

Best Regards,
Community Support Team _ Eason

 

Anonymous
Not applicable

Hi @amitchandak 

 

Thanks for your reply.

 

I should have mentioned that the underlying data only contains appointments for the current week, so theres no need to distinguish which week the appointment is for.  Essentially what I need is for the numbers in the below column to be totaled up (by room location, for example London).

 

tempsnip.png

 

 

 

 

 

 

 

 

 

 

 

 

I've tried to create a measure like the one you suggested to do this, but its my understanding I can't use sum for a measure. How do I sum measures?

 

Additionally, I need help with the second column, which works out the total capacity utilised. If you could give me any pointers on this id really appreciate it.

 

Thanks!

 

 

 

amitchandak
Super User
Super User

@Anonymous , if available this week is ums from daily. You can have week in you date table and create the measures 

 

example with help from date table

new columns in date table

Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1
Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)
Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)

or
Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //YYYYMM format

 

 

measures example

This Week = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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