Forum Discussion

menphis21's avatar
menphis21
Helper IV
4 years ago

How to create measure with dynamic aggregation and format ?

Hi,

 

Supposed that i have a database with fews variable like : 

variable value 
Total Profit100,687
Investments Profit19,747
Gross Loss Ratio32%
Net Loss Ratio54%

 

 

The variable will be in the filter section and i would like to show depending on the selection the right format on a clustered bar.

In a simple table, it work but not on the graph because of the X axis who stay between 0 and 1.

 

_values4 = SWITCH(
                true(),
                 
                  "Total Profit" in ALLSELECTED('Global'[variable]), [sum_value] ,
                  "Investments Profit" in ALLSELECTED('Global'[variable]), [sum_value] ,
                    "Gross Loss Ratio" in ALLSELECTED('Global'[variable]), [avg_value] )
 
with the
Sum_value = sum('Global'[value]) and 
Avg_value =  average('Global'[value])
 
I tried to change the Avg_value with format function or contatenate but its not working
Avg_value = CONCATENATE( average('Global'[value])*100 , "%")
 
If someone can help 🙂
 
thank you
 

 

5 Replies