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
Flash9883
New Member

Data Aggregation issue

Good afternoon,

 

I have a data set that row calculations are correct but column total is not. How can i fix the aggregation.

 

Flash9883_0-1748719552115.png

The underlined 22 is suppose to be a sum. The issues that could be happenning is im filtering by a REG and WRKHM on the rpt date column. if payroll changes occur then multiples might occur on same day. The goal is to figure out how many days an employee has worked in a given time period.

 

This is the formula im using to get the result in the picture.

 

SUMX(
    SUMMARIZE(
        FILTER(TRC_Table, TRC_Table[TRC] IN {"REG", "WRKHM"}),
        TRC_Table[Date],
        "UniqueCount", DISTINCTCOUNT(TRC_Table[Date])
    ),
    [UniqueCount]
)
2 ACCEPTED SOLUTIONS
Fowmy
Super User
Super User

@Flash9883 

Based on the limited information you have shared here, I guess you need to include the employee number in the logic as each row belongs to an employee and you need to het the aggregate in the same manner, try this, replace the employee number in the with your correct column:

SUMX (
    SUMMARIZE (
        FILTER ( TRC_Table, TRC_Table[TRC] IN { "REG", "WRKHM" } ),
        TRC_Table[EmployeeNo], 
        TRC_Table[Date],
        "UniqueCount", DISTINCTCOUNT ( TRC_Table[Date] )
    ),
    [UniqueCount]
)



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

V-yubandi-msft
Community Support
Community Support

Hi @Flash9883 ,

Please consider marking it as the Accepted Solution if it helped resolve your issue. It will be helpful for others in the community who might be facing a similar problem.

 

Thank you for your understanding.

View solution in original post

6 REPLIES 6
V-yubandi-msft
Community Support
Community Support

Hi @Flash9883 ,

Please consider marking it as the Accepted Solution if it helped resolve your issue. It will be helpful for others in the community who might be facing a similar problem.

 

Thank you for your understanding.

V-yubandi-msft
Community Support
Community Support

Hi @Flash9883 ,

If your issue is resolved, it would be great if you could mark the response as the Accepted Solution. This helps others in the community find answers more easily when they face similar challenges.

 

We really appreciate @Fowmy  & @techies  your clear explanation and the valuable contributions from community members.

 

If you have more questions or need further support, don’t hesitate to post again the community is always here to help.

 

Yugandhar

Community Support Team.

Flash9883
New Member

This solution worked as well. Thanks to both of you.

Flash9883
New Member

Thanks for the assist this solution worked.

Fowmy
Super User
Super User

@Flash9883 

Based on the limited information you have shared here, I guess you need to include the employee number in the logic as each row belongs to an employee and you need to het the aggregate in the same manner, try this, replace the employee number in the with your correct column:

SUMX (
    SUMMARIZE (
        FILTER ( TRC_Table, TRC_Table[TRC] IN { "REG", "WRKHM" } ),
        TRC_Table[EmployeeNo], 
        TRC_Table[Date],
        "UniqueCount", DISTINCTCOUNT ( TRC_Table[Date] )
    ),
    [UniqueCount]
)



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

techies
Solution Sage
Solution Sage

Hi @Flash9883 please try this

 

Days Worked =
SUMX(
VALUES(TRC_Table[EmployeeID]),
CALCULATE(
DISTINCTCOUNT(TRC_Table[Date]),
TRC_Table[TRC] IN {"REG", "WRKHM"}
)
)

― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978

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.