Forum Discussion

Ttaylor9870's avatar
Ttaylor9870
Helper III
4 years ago
Solved

Hiding duplicate values in a Column

Hi All,

 

I have a table as follows which is extremly over simplfied and for privacy reasons I can't show the specific data I am working with...

 

A     |      B       |     C  

1       Walter          5

2        Walter         5

3        Jesse           3

4        Saul             2

5       Badger          1

                    Total: 11

 

Walter has the Value 5 and it hasn't been counted twice which is great,

I would like to know is there a DAX function where I can have my table output the following...

 

A     |      B       |     C  

1       Walter          5

2        Walter         

3        Jesse           3

4        Saul             2

5       Badger          1

                    Total: 11

 

Hides the duplicate value yet the rest of the row remains?

 

Many Thanks

  • Hey,

     

    Give this a try:

    D =
    VAR A_B =
        CALCULATETABLE (
            SUMMARIZE ( 'Table', 'Table'[A], 'Table'[B] ),
            ALLEXCEPT ( 'Table', 'Table'[B] )
        )
    VAR RankA_B =
        RANKX ( A_B, 'Table'[A],, ASC )
    VAR Result =
        IF ( RankA_B = 1, 'Table'[C] )
    RETURN
        Result

1 Reply

  • Barthel's avatar
    Barthel
    Solution Sage

    Hey,

     

    Give this a try:

    D =
    VAR A_B =
        CALCULATETABLE (
            SUMMARIZE ( 'Table', 'Table'[A], 'Table'[B] ),
            ALLEXCEPT ( 'Table', 'Table'[B] )
        )
    VAR RankA_B =
        RANKX ( A_B, 'Table'[A],, ASC )
    VAR Result =
        IF ( RankA_B = 1, 'Table'[C] )
    RETURN
        Result