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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Calculate sum IF conditions filled from another table

Hello peeps,

 

I am trying to create a measure "PROD-time_unit (h)" which gives me the sum of a collum ([time_unit (h)]). I only want to sum values, though, that have a higher value than 2 from a different (related table) collum.

 

To make this less abstract here more detail:

There is 'time_accounting'[time_unit (h)] and [configitem.class_id].

The ID is basically different groups and the time_accounting is linked to each group individually.

I now want to sum all the values from these groups.

I only want to sum values from [time_unit (h)] that have a higher ID from [configitem.class_id] > 2.

 

How is this possible? Does anyone have an idea?

I hope one of the explanations above will help understand the issue. Its actually quite simple, but I haven't yet found a way for DAX to do it.

 

All the best,

Julius

 

1 ACCEPTED SOLUTION
d_gosbell
Super User
Super User

This should not be too hard. Assuming that there is a many to one relationship from the 'time_accounting' table to the other table with the  [configitem.class_id] column you could use an expression like the following:

 

= CALCULATE( SUM( 'time_accounting'[time_unit (h)] ), 'other table' [configitem.class_id] > 2)

View solution in original post

1 REPLY 1
d_gosbell
Super User
Super User

This should not be too hard. Assuming that there is a many to one relationship from the 'time_accounting' table to the other table with the  [configitem.class_id] column you could use an expression like the following:

 

= CALCULATE( SUM( 'time_accounting'[time_unit (h)] ), 'other table' [configitem.class_id] > 2)

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.