Forum Discussion

vijaykumarj19's avatar
vijaykumarj19
Icon for Microsoft Employee rankMicrosoft Employee
4 years ago
Solved

Show measure total based on filter

Dataset:

My measure(M_C3-C2) total should display 11 in card but it is displaying 80 

measure:

M_C2-C3 =
var a = SUM('Table'[c3]) - SUM('Table'[c2])
return
IF(SUM('Table'[c2])=BLANK(),BLANK(),a)
 
Please help me 

 

  •  

    M_c3-c2 : =
    SUMX ( FILTER ( 'Table', 'Table'[c2] <> BLANK () ), 'Table'[c3] - 'Table'[c2] )

     

     

2 Replies

  •  

    M_c3-c2 : =
    SUMX ( FILTER ( 'Table', 'Table'[c2] <> BLANK () ), 'Table'[c3] - 'Table'[c2] )

     

     

  • vijaykumarj19 

    You can use it this way:

    M_C2-C3 =
    SUMX (
        'Table',
        IF (
            'Table'[c3] <> BLANK ()
                && 'Table'[c2] <> BLANK (),
            'Table'[c3] - 'Table'[c2]
        )
    )