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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.