Conditional calculation and displaying values

Hi all,

I want to present a result based on a choice on the slicer, but if nothing has been selected, I want to present the average for a specific item.

sample.pbix (26.7 KB)

I appreciate your help.
Thanks

Joao Monteiro

@JoaoMonteiro,

This solution is based on the fact that SELECTEDVALUE allows you to return an alternate value if there is no single selected value.

Harvest Team = SELECTEDVALUE( Teams[Team], “Average” )

From this, you can branch:

Card Points = 
IF(
    [Harvest Team] = "Average",
    [Avg Points],
    CALCULATE(
        MAX( 'Table'[Points] ),
        FILTER( ALL( 'Table' ), 'Table'[Team] = [Harvest Team] )
    )
)

Title Text = IF( [Harvest Team] = “Average”, “Chelsea”, SELECTEDVALUE( Teams[Team] ) )

Which when set as the title using conditional formatting gives this result:

image

image

I hope this is helpful. Full solution file posted below.

2 Likes

Hi @BrianJ

This solution is almost what I want, but not quite.
I explain why:

  • When ‘Chelsea’ is selected I want to present the result of ‘Chelsea’, which is 50 points.
  • When none is selected, I want to present ‘Chelsea’ to appear but instead of 50 points, I want to show the average points for all teams.

Regards,
Joao Monteiro

Hello @JaoMonteiro,

In the solution provided by Brian:

  1. you see 50 when “Chelsea” is selected
    image

  2. When none is selected, It is presented “Chelsea” with the average points for all teams

It is not the solution you are looking for?

1 Like

Hi @BrianJ

Your solution is in line with what I asked for.
I was the one who misunderstood the explanation.

I want to show it in a bar graph

  • If no team is selected, then it shows ‘Chelsea’ with the average of all teams; (pic 1)
  • If a team selected, it shows the value of that team (pic 2)

Thanks
Regards,
Joao Monteiro

@JoaoMonteiro,

This uses the exact same logic and measures as the card solution, just organized a little bit differently in the visual:

Snag_1510b34

Snag_1517c9b

Full solution file attached below.

– Brian
eDNA Forum – Conditional Card Selection Solution2.pbix (26.6 KB)

Hi @JoaoMonteiro, we’ve noticed that no response has been received from you since the 15th of April. We just want to check if you still need further help with this post? In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved.

Hi @JoaoMonteiro, due to inactivity, a response on this post has been tagged as “Solution”. If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the check box.

We’ve recently launched the Enterprise DNA Forum User Experience Survey, please feel free to answer it and give your insights on how we can further improve the Support forum. Thanks!