Forum Discussion

Warner's avatar
Warner
New Member
5 years ago
Solved

Column Count for total and %

Hi All,    I have 2 columns within a table (see below).    What i am trying to do it get the Top % total of either M or F in a card visual for example (M = 51%).    I am also trying to do the s...
  • v-luwang-msft's avatar
    5 years ago

    Hi Warner ,

    Try the measure like below:

    TEST = 
    VAR TESTALL =
        CALCULATE ( COUNTROWS ( 'Table' ), ALL ( 'Table' ) )
    VAR COUNT1 =
        CALCULATE (
            COUNTROWS ( 'Table' ),
            FILTER (
                ALL ( 'Table' ),
                'Table'[Client Gender] = SELECTEDVALUE ( 'Table'[Client Gender] )
            )
        )
    VAR ALL1 =
        DIVIDE ( COUNT1, TESTALL, 4 )
    RETURN
        FORMAT ( ALL1, "0%" )

    Since I do not have your specific data, I have created a sample,return:

     

     

     And you could do the same for Ethnicity.

     

     

     

     

    Did I answer your question? Mark my post as a solution!


    Best Regards

    Lucien