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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

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 @Anonymous

 

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 ) )
    )
)

View solution in original post

3 REPLIES 3
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous

 

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 ) )
    )
)
Anonymous
Not applicable

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

hi @Anonymous

 

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 ) )
    )
)

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.