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

Calculating measure based on column groupings

Hi everyone!

 

I'm trying to calculate a measure based on column groupings but unsure how to make it work when aggregated as currently I'm using MIN which won't be correct when aggregated.

 

IF( MIN([Grouping]) = "Include", IF( [Years] >=1, [logic if true], IF( MIN[Grouping) = "Exclude",  IF( [Years >= 1, [logic if true], [logic if false]))

 

How can I make this work for the aggregated value?

 

The data is structured like this

GroupingValueYears
Include1231
Include3451.4
Exclude1235.3
Exclude8572.3
Exclude1236.5

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , This type of formula should work

Switch( True() ,
Min([Grouping]) = "Include" && min([Years]) >=1, [logic if true] ,
MIN([Grouping]) = "Exclude" && min([Years]) >= 1 ,[logic if true] ,
[logic if false]
)

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , This type of formula should work

Switch( True() ,
Min([Grouping]) = "Include" && min([Years]) >=1, [logic if true] ,
MIN([Grouping]) = "Exclude" && min([Years]) >= 1 ,[logic if true] ,
[logic if false]
)

Anonymous
Not applicable

Thanks!

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.