Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Create measure as per referred column value

Hi,

 

I have a table and it has 10k rows data. 

The data is calculated by KPI Title.

Hope if the Unit is [%] then calculate for average, if not then calculate for sum. 

Pls help me to make measure. 

 

 

  • Hello Anonymous, 

    hope you are doing great, 

     

     i think you can use a switch ( true () ,  statement with selectedvalue  

    so example : 

    switch (

    true() ,

    selectedvalue(tablename[unit]) = "[%]" , average ( col ) , 

    sum ( col )

    )

     

    hope this helps. 

1 Reply

  • Daniel29195's avatar
    Daniel29195
    Icon for Community Champion rankCommunity Champion

    Hello Anonymous, 

    hope you are doing great, 

     

     i think you can use a switch ( true () ,  statement with selectedvalue  

    so example : 

    switch (

    true() ,

    selectedvalue(tablename[unit]) = "[%]" , average ( col ) , 

    sum ( col )

    )

     

    hope this helps.