Forum Discussion

dofrancis3's avatar
dofrancis3
Resolver I
1 year ago

Conditional Sum calcution between two tables

Dear Team,
Please i need your help !
I would like to calculate the PERCENTAGE as per the formula below : by country, Year and Quarter.
The sample Excel data can be found Here.
Thank you for your support 
 

 

3 Replies

  • BeaBF's avatar
    BeaBF
    Super User

    dofrancis3 Hi! Create a measure like:

    D1_Percentage =
    VAR Z_Value = LOOKUPVALUE( Table1[Z], Table1[Country], SELECTEDVALUE(Table2[Country]) )
    RETURN DIVIDE( Table2[D1a] + Table2[D1b], Z_Value, 0)

    D9_Percentage =
    VAR Z_Value = LOOKUPVALUE( Table1[Z], Table1[Country], SELECTEDVALUE(Table2[Country]) )
    RETURN DIVIDE( Table2[D9], Z_Value, 0)

    MC1_Percentage =
    VAR U_Value = LOOKUPVALUE( Table1[U], Table1[Country], SELECTEDVALUE(Table2[Country]) )
    RETURN DIVIDE( Table2[MC1], U_Value, 0)

    -- Repeat for other percentages using the same pattern

     

    BBF

    • dofrancis3's avatar
      dofrancis3
      Resolver I

      Dear BeaBF ;

      Please could you check again it doen't work it give me 0% will i have data

      Please advise