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
Haidarius
Frequent Visitor

DAX measure or calculated column Logic help

Hello!

 

I have a matrix set up as the figure below

Haidarius_0-1665690103543.png

Basically the hierarchy of rows is NAME > GROUP > SECTION

The grouping was done automatically in powerBI matrix..

 

When you expand a GROUP within a NAME you will get the following breakdown along with the column1 values as shown

Haidarius_1-1665690216265.png

I want to create a measure or a calculated column that is conditional based on the values of column1 within each GROUP..

So if a GROUPhas atleast one value that says BLUE, then the result would return TRUE for all the SECTIONS within that group, and if none of the columns have BLUE, then return FALSE as shown below

 

Haidarius_2-1665690362795.png

 

I have been trying for a while now, any help is appreciated!

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

Hi @Haidarius ,

I have created a simple sample, please refer to it to see if it helps you.

Create 2 measures.

_1 = IF(MAX('Table'[VALUE])="Blue",1,0)

result =
VAR _1 =
    MAXX (
        FILTER ( ALL ( 'Table' ), 'Table'[name] = SELECTEDVALUE ( 'Table'[name] ) ),
        [_1]
    )
RETURN
    IF ( _1 = 1, TRUE (), FALSE () )

vpollymsft_0-1665711846356.png

 

 

Best Regards

Community Support Team _ Polly

 

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

3 REPLIES 3
v-rongtiep-msft
Community Support
Community Support

Hi @Haidarius ,

I have created a simple sample, please refer to it to see if it helps you.

Create 2 measures.

_1 = IF(MAX('Table'[VALUE])="Blue",1,0)

result =
VAR _1 =
    MAXX (
        FILTER ( ALL ( 'Table' ), 'Table'[name] = SELECTEDVALUE ( 'Table'[name] ) ),
        [_1]
    )
RETURN
    IF ( _1 = 1, TRUE (), FALSE () )

vpollymsft_0-1665711846356.png

 

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

My data set has the same group under different names, I believe that's why I cannot achieve your results (all true)

I added a second filter outside of the one in VAR HBP with the same conditions for name but for group and it worked

Hi @Haidarius ,

Does my answer help? If not, please provide your pbix file without privacy information.

 

How to Get Your Question Answered Quickly 

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

Top Solution Authors