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
MC777
New Member

At least one value marks all values

I need help.

 

I currently have this kind of data (green cells). I would need to add a new column that would contain the value "yes" if there is at least one "yes" for a given order.

 

I hope you understand me.

 

MC777_0-1679054983456.png

 

 

How can I do that?

 

MC

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

try to write like this

Column = 
VAR _order = 'Table'[order]
VAR _RESULT =
    CALCULATE (
        COUNTROWS (),
        FILTER (ALL ( 'Table' ),
                'Table'[order] = _order
                && 'Table'[something] = "yes")
    )
RETURN
    IF ( _RESULT = 1, "YES", "NO" )


Screen Capture #640.png

View solution in original post

1 REPLY 1
Ahmedx
Super User
Super User

try to write like this

Column = 
VAR _order = 'Table'[order]
VAR _RESULT =
    CALCULATE (
        COUNTROWS (),
        FILTER (ALL ( 'Table' ),
                'Table'[order] = _order
                && 'Table'[something] = "yes")
    )
RETURN
    IF ( _RESULT = 1, "YES", "NO" )


Screen Capture #640.png

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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