Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Percentage between two columns

Good day, 

 

I have two tables, related to each other by fist column (name of the source file). I'm looking for measure to show me how many "RISK and HIGH RISK" checks were done comparing to "none or standard". Result should be in procents and filtered by year (2021)

 

SOURSE FILE NAMEREASON FOR CHECK   SOURSE FILE NAMEDate of Check
1none  12020
2risk  22020
3high risk  32021
4none  42021
5standard  52021
6risk  62021

 

For example in 2021 there were 4 checks where two of these were (Risk/High Risk) - final result is 50% in 2021. 

 

Thnaks

Aleks 

1 Reply

  • Anonymous,

     

    Try these measures:

     

    Check Count = COUNT ( CheckReason[SOURSE FILE NAME] )
    
    Check Percent = 
    VAR vNumerator =
        CALCULATE (
            [Check Count],
            CheckReason[REASON FOR CHECK] IN { "risk", "high risk" }
        )
    VAR vDenominator = [Check Count]
    VAR vResult =
        DIVIDE ( vNumerator, vDenominator )
    RETURN
        vResult