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
Crowdak
Regular Visitor

Getting a sum of a percentage in my visual instead of an average for the week

Hello,

 

I am trying to get a visual that shows 3 things: Average of % reservation of an office per week, Average of % presence of an office per week, Max % presence of an office within the week.

 

Right now I've been doing the percentage, for both reservation and presence, using a measure. But when I add it to a visual, I get the sum of every % instead of the average of each day in the week.

 

Maybe the method I use isn't the proper one 

 

Table   
Reservation  
    
NameEmailOfficeDate
John Smithjsmith@contoso.comA110-Oct-24
John Smithjsmith@contoso.comA111-Oct-24
Bob Loblawbloblaw@contoso.comA310-Oct-24

 

Table   
Presence   
    
NameEmailOfficeDate
John Smithjsmith@contoso.comA110-Oct-24
John Smithjsmith@contoso.comA111-Oct-24
Bob Loblawbloblaw@contoso.comA310-Oct-24
Bob Loblawbloblaw@contoso.comA211-Oct-24

 

Table 
Reservable Offices
  
OfficeReservable
A1TRUE
A2TRUE
A3TRUE
A4FALSE

 

Measures
Total amount of reservable office =  CALCULATE(COUNT('Total amount of reservable office'[Office]), ('Total amount of reservable office'[Reservable]="True"))
 
 
%Reservation = CALCULATE((COUNT('Reservation'[Name]))/([Total amount of reservable office]))

 

Can you help out a newby? 

Also, when I right click on the measure in my Y Axis, I don't see the options to change the agreggation to AVG instead of sum.

Crowdak_0-1730397486860.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the reply from FreemanZ , please allow me to provide another insight:

Hi, @Crowdak 

1.Firstly, you might also consider trying the following measure. However, please note that the time column in the VALUES() function may need to be adjusted based on your actual data, as I currently have limited information and am unsure about your table relationships.

Avg % Reservation = 
AVERAGEX(
    VALUES('Reservation'[Date]),
    CALCULATE(COUNT('Reservation'[Name]) / [Total amount of reservable office])
)
Avg % Presence = 
AVERAGEX(
    VALUES('Presence'[Date]),
    CALCULATE(COUNT('Presence'[Name]) / [Total amount of reservable office])
)
Max % Presence = 
MAXX(
    VALUES('Presence'[Date]),
    CALCULATE(COUNT('Presence'[Name]) / [Total amount of reservable office])
)

vlinyulumsft_1-1730704117667.png

2.Secondly, if you have a clear understanding of your calculation logic, the most effective approach would be to convert your measure into a calculated column. This would allow for quicker aggregation, for example:

vlinyulumsft_2-1730704117668.png

 

Please find the attached pbix relevant to the case.

 

Best Regards,

Leroy Lu

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
Anonymous
Not applicable

Thanks for the reply from FreemanZ , please allow me to provide another insight:

Hi, @Crowdak 

1.Firstly, you might also consider trying the following measure. However, please note that the time column in the VALUES() function may need to be adjusted based on your actual data, as I currently have limited information and am unsure about your table relationships.

Avg % Reservation = 
AVERAGEX(
    VALUES('Reservation'[Date]),
    CALCULATE(COUNT('Reservation'[Name]) / [Total amount of reservable office])
)
Avg % Presence = 
AVERAGEX(
    VALUES('Presence'[Date]),
    CALCULATE(COUNT('Presence'[Name]) / [Total amount of reservable office])
)
Max % Presence = 
MAXX(
    VALUES('Presence'[Date]),
    CALCULATE(COUNT('Presence'[Name]) / [Total amount of reservable office])
)

vlinyulumsft_1-1730704117667.png

2.Secondly, if you have a clear understanding of your calculation logic, the most effective approach would be to convert your measure into a calculated column. This would allow for quicker aggregation, for example:

vlinyulumsft_2-1730704117668.png

 

Please find the attached pbix relevant to the case.

 

Best Regards,

Leroy Lu

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

 

Thanks a lot for your help

FreemanZ
Super User
Super User

hi @Crowdak ,

 

we can select avg, min, max of a native column field, but we cant do that for measures.

 

so in your case, you would need to write separate measures for average, max values.

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.