Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Need help with dividing two different grouped value from different tables

Hi everyone,   I'm fairly new to the powerbi and hope that someone could share his/her wisdom to help me solve the problem.   The basic requirement for the task is that the aggregated fees groupe...
  • johnt75's avatar
    3 years ago

    First create a new type dimension table like

    Type dimension =
    DISTINCT ( UNION ( DISTINCT ( 'Table1'[Type] ), DISTINCT ( 'Table2'[Type] ) ) )
    

    and link that to both tables. Make sure to use the column from that table in your visuals.

    You can then create a measure like

    New measure =
    VAR Tab1Value =
        SUM ( 'Table1'[Fees] )
    VAR Tab2Value =
        SUM ( 'Table2'[Amount] )
    RETURN
        IF (
            ISBLANK ( Tab1Value ) || ISBLANK ( Tab2Value ),
            0,
            DIVIDE ( Tab1Value, Tab2Value )
        )