Forum Discussion

davehardikkumar's avatar
3 years ago
Solved

distinct total

Hello Friends I need help with distinct total.

 

 

Below is table

column1         Column2

A                      10

B                       20

A                       10

C                      30

 

the desired output is

 

Coulmn2

10

20

30

------

Total= 10

 *total should be 10 as I want to sum only distinct values and want to display non distinct value in column. Is that possible?

  • tamerj1's avatar
    tamerj1
    3 years ago

    davehardikkumar 
    Place Column1 in a table visual along with the following measure

    Column2Measure =
    VAR T =
        SUMMARIZE ( 'Table', 'Table'[Column1], 'Table'[Column2] )
    RETURN
        IF (
            HASONEVALUE ( 'Table'[Column1] ),
            SUMX ( T, 'Table'[Column2] ),
            SUMX (
                T,
                IF ( COUNTROWS ( CALCULATETABLE ( 'Table' ) ) >= 2, 'Table'[Column2] )
            )
        )

8 Replies