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
rax99
Helper V
Helper V

How to conditionally assign new values to Aggregated values

Matrix below shows day number as columns, and customers by row. The values are simply a count of the calls.

 

matrix.pngI

 

I need the values to show either a 1 or a 0 depending on if there are values in that cell. so when Count(NID) is blank, then 0 ELSE 1. 

Then the totals at the bottom of the matrix should sum up the 1s down the column,

 

Any ideas?

1 ACCEPTED SOLUTION

hi @rax99

 

Try this

 

Measure =
IF (
    HASONEFILTER ( table1[Customer] ),
    IF ( COUNT ( Table1[NID] ) > 0, 1, 0 ),
    SUMX (
        VALUES ( table1[Customer] ),
        CALCULATE ( IF ( COUNT ( Table1[NID] ) > 0, 1, 0 ) )
    )
)

Regards
Zubair

Please try my custom visuals

View solution in original post

3 REPLIES 3
Zubair_Muhammad
Community Champion
Community Champion

@rax99

 

Give this MEASURE a shot

 

Measure=
IF (
    HASONEFILTER ( table1[Customer] ),
    IF ( COUNT ( Table1[NID] ) > 0, 1 ),
    SUMX (
        VALUES ( table1[Customer] ),
        CALCULATE ( IF ( COUNT ( Table1[NID] ) > 0, 1 ) )
    )
)

Regards
Zubair

Please try my custom visuals

Brilliant That worked! Any idea how to populate the rest of the matrix with 0s where there is no value?

hi @rax99

 

Try this

 

Measure =
IF (
    HASONEFILTER ( table1[Customer] ),
    IF ( COUNT ( Table1[NID] ) > 0, 1, 0 ),
    SUMX (
        VALUES ( table1[Customer] ),
        CALCULATE ( IF ( COUNT ( Table1[NID] ) > 0, 1, 0 ) )
    )
)

Regards
Zubair

Please try my custom visuals

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.