Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
jochendecraene
Helper IV
Helper IV

KPI unichar based on average

Hi

 

I've created a KPI with DAX measure using swith & unichar. I want the KPI to based on an average (by category). So the KPI has to change depending on this average by category. Since I can not use the average in a calculated column I needed to create some measures first that I can use in this formula:

Knipsel.JPG

 

Now, this means I have to create a lot of extra work, since I have lots of tables ... I've tried this solution, that seems to work. But I'm not sure that this is a good solution. Maybe there is a better way. Can someon give me some feedback or advice?

 

Knipsel1.JPG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @jochendecraene ,

 

You say that you cannot use the average in a calculated column. Why is that?

If you create a column with the following formula, you get the results you want I think.

 

Unichar =
Var _AverageByCat = CALCULATE( AVERAGE( 'Poverty'[MS Very Hard] ) , ALLEXCEPT('Poverty' ,'Poverty'[Category] ) )
Return
IF( Poverty[MS Very Hard] > _AverageByCat , UNICHAR(9650) , BLANK() )

View solution in original post

4 REPLIES 4
v-xiaoyan-msft
Community Support
Community Support

Hi @jochendecraene ,

 

Based on what you have mentioned above, I hope I have understood your needs correctly.
You want to create a KPI which is based on the average of the categories.
Show arrow when [Very Hard] column > average, otherwise blank.

 

If so, then Noeleke gave the right answer and you should create a calculated column instead of a Measure. You don't need to create a separate Measure for the average to do the calculation, you can do what he said and create a calculated column.

 

vcaitlynmstf_1-1639389797518.png

 

As for your 2nd problem, Sometimes when the results logic test are equal, I get an arrow, sometimes not.

In the calculation of your measure (average), it is automatically rounded, for example, in the second line of V12, although it shows 3%, the actual average is only 2.75%.

 

 

Hope it helps,


Community Support Team _ Caitlyn

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

Thnx, this helped me!

Anonymous
Not applicable

Hi @jochendecraene ,

 

You say that you cannot use the average in a calculated column. Why is that?

If you create a column with the following formula, you get the results you want I think.

 

Unichar =
Var _AverageByCat = CALCULATE( AVERAGE( 'Poverty'[MS Very Hard] ) , ALLEXCEPT('Poverty' ,'Poverty'[Category] ) )
Return
IF( Poverty[MS Very Hard] > _AverageByCat , UNICHAR(9650) , BLANK() )

This gives me an error in the second part of the formula. Seems dax doesn't recongnize the column

 

Knipsel.JPG

If I adjust this part, It seems to work, and I don't need any measures, exept, there is somethin else wrong. Sometimes when the results logic test are equal, I get an arrow, sometimes not ...

Knipsel1.JPG

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.