Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

How to create measures that function across multiple columns

Hi,   I have a problem that seems simple but is somewhat complicated to me.  I'm working with a cumbersome excel table that another team in my workplace uploads to our organization's SharePoint 365...
  • v-alq-msft's avatar
    5 years ago

    Hi, Anonymous 

     

    I am sorry for the late reply. Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

    Table:

     

    You may go to Power Query=>click 'Transform'=>make 'C1'-'C6' selected=>click 'Unpivot Columns'.

     

     

    Then you may create two measures as below.

    Criteria Met = 
    COALESCE(
        DIVIDE(
            COUNTROWS(
                FILTER(
                    'Table',
                    [Value]="CM"
                )
            ),
            COUNTROWS(
                'Table'
            )
        ),
        0
    )

     

    Criteria Not Met = 
    COALESCE(
        DIVIDE(
            COUNTROWS(
                FILTER(
                    'Table',
                    [Value]="CNM"
                )
            ),
            COUNTROWS(
                'Table'
            )
        ),0
    )

     

    Result:

     

    Best Regards

    Allan

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.