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
Powereports
Helper I
Helper I

Totals not showing correctly for a dax measure

Hi everyone,

 I have the below dax measure as below which works perfect at the employee level drill down highted in yellow in Screenshot: 1, but as we drill a level up i.e ( RPN infusion in screenshot below ) the totals don't show up correctly as highted in red in screenshot below. I tried using SUMX as well but it doesn't work well.

Please let me know if I am missing something.

Dax measure:

Powereports_1-1641843896129.png

Screenshot 1:

Powereports_3-1641844759462.png

Thanks in advance ,

Powerreports


 

 

2 ACCEPTED SOLUTIONS
PaulOlding
Solution Sage
Solution Sage

Hi @Powereports 

Without sample (raw) data this will be difficult to diagnose.  Does this give you what you want?

Average Hours Per Period =
CALCULATE(
    AVERAGEX(
        SUMMARIZE(Utilization, Utilization[EMPL_ID], Datetable[Date]),
        SUM(Utilization[UTILIZATION])
        ),
    USERELATIONSHIP(Datetable[Date], Utilization[check Date])
    )

View solution in original post

Anonymous
Not applicable

Hi @Powereports ,

 

[Utilized Utilization(Hours Worked per pay period)] field selects Average.

vstephenmsft_0-1642041016167.png

vstephenmsft_1-1642041154749.png

 

Is this the result you want? If not, please provide your expected result.

 

Best Regards,

Stephen Tao

 

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
Powereports
Helper I
Helper I

Hi Paul,

 Here is the raw sample data below:

To explain i am using a matrix visual and have three levels of Heirarchy : MonthYear,Category and Employee.

So i want to know  average hours per month, per category and employee as and when i drill down.

My problem is the the dax below gives correct result at the lowest level of drill down i.e employee level but one level up i.e category the results are screwed.

For example for the screenshot below at category: (RN Infusion)  the result for average hours should be 25 and not 8.80 as highlighted in red.

Dax used for calculation :

Powereports_1-1641849233195.png

 

Screenshot : 

Powereports_0-1641849120281.png

 

 

Mon-YearRoleStaff NamePayCheck DateStaff UtilizedUtilization(Hours Worked per pay period)
Sep-21RN InfusionHaley 9/10/202117
Sep-21RN InfusionKimberly 9/3/2021128
Sep-21RN InfusionKimberly 9/17/2021131
Sep-21RN InfusionMelissa 9/24/2021123
Sep-21RN InfusionNick 9/3/2021185
Sep-21RN InfusionNick 9/17/202111
Sep-21RN InfusionRowena 9/3/20211

1

 

 

Anonymous
Not applicable

Hi @Powereports ,

 

[Utilized Utilization(Hours Worked per pay period)] field selects Average.

vstephenmsft_0-1642041016167.png

vstephenmsft_1-1642041154749.png

 

Is this the result you want? If not, please provide your expected result.

 

Best Regards,

Stephen Tao

 

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

 

PaulOlding
Solution Sage
Solution Sage

Hi @Powereports 

Without sample (raw) data this will be difficult to diagnose.  Does this give you what you want?

Average Hours Per Period =
CALCULATE(
    AVERAGEX(
        SUMMARIZE(Utilization, Utilization[EMPL_ID], Datetable[Date]),
        SUM(Utilization[UTILIZATION])
        ),
    USERELATIONSHIP(Datetable[Date], Utilization[check Date])
    )

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.