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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
PhotoBiker
Advocate I
Advocate I

DAX: Selective sum

Hi community,

 

I'm trying to understand how to use DAX calculations on a flattened table, a simple "sum" doesn't work because the flattened table has too many rows.

 

Scenario: There's an event that lasts 2 hours. During this event, 2 workers simultanously provide service to 3 clients. Clients may be present during the entire event duration, or less. If I put this information in a flat table, it looks like this:

 

ExampleForSelectiveSums.png

 

There are six rows because there are 2 workers x 3 clients. Client C1 attended 2 hours, C2 1 hour, and C3 0.5 hours, so "customer time" is 3.5 hours. The two workers each were available 2 hours, so in total that's 4 hours. Obviously, adding the columns would return wrong results.

 

I'm looking for a DAX statement that sums up time per worker and per client, but only once per event. The example above has only one event, but there would be many more, e. g. E2, where only 2 customers and 1 worker attended. So my goal is to consider values within the same group only once (I marked "same groups" by colour).

 

I'd really appreciate some help here, this would make my data model much easier (currently I can only achieve that by separating it into related tables).

 

Thanks in advance.

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@PhotoBiker,

 

It seems that you've resolved this problem here.

Community Support Team _ Sam Zha
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

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@PhotoBiker,

 

It seems that you've resolved this problem here.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-chuncz-msft,

 

Thank you for pointing that out - and sorry for the double posting (or rather not updating the post here), my bad!

 

Indeed, I received feedback in the other forum that offered me options to solve my issue.

 

Thanks for looking into it!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.