cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
christinek
Frequent Visitor

Card to show value depending on slicer selection

Hi all.

I have a slicer with 3 selection options for "Std Matter".

Just to show my issue, I have created 3 separate cards to show a value for each option.

But what I want if possible, is only one card to show the relevant value, based on the slicer selection.

christinek_0-1679449446728.png

 

I am also not sure if I have done this correctly, but the 3 values are just a fixed "expected value". I added 3 measures:

christinek_1-1679449544206.png

where for example: 

Expected Individual Returns = 1947
 
If there is a better way to add these 3 fixed values, please advise?
Would appreciate any assistance to achieve above.
1 ACCEPTED SOLUTION

Hi @christinek,

So you mean return specific value based on current selection? If that is the case, you can use SWITCH and SELECTEDVALUE function as following measure formula:

formula =
VAR selected =
    SELECTEDVALUE ( Table[Column] )
RETURN
    SWITCH (
        selected,
        "Business Compliance 2022", 1125,
        "Individual Returns 2022", 1947,
        "Super Fund Taxation & Accounts", 479,
        0
    )

You can use this in the card visual and it will return static values based on current selections.(notice: these can only achieve in measure formula because power bi does not support create dynamic calculate column/table based on filter selections)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

4 REPLIES 4
v-shex-msft
Community Support
Community Support

Hi @christinek,

If you mean add up three formula results, I’d like to suggest you create a new measure invoke and calculate with these formulas.

In addition, you can also take a look at the following link about use switch to redirect to different calculation based on current selections:

My Favorite DAX Feature: SELECTEDVALUE with SWITCH | Winston-Salem Power BI User Group (pbiusergroup...

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi, thank you for suggestion and detail. I don't actually want a SUM.

What I want to appear in the CARD is 

if slicer selection = Business Compliance 2022, CARD to show 1125 (fixed value)

if slicer selection = Individual Returns 2022, CARD to show 1947 (fixed value)

if slicer selection = Super Fund Taxation & Accounts, CARD to show 479 (fixed value).

 

I have tried to use your suggestion, but not getting the reult I am after. This is what I have done:

 

christinek_0-1679870379971.png

 

christinek_1-1679870432971.png

where:

christinek_2-1679870467929.png

christinek_3-1679870492530.png

christinek_4-1679870516487.png

I hope this is clearer.

Shuold I still be able to use your suggestion and if so, where have I gone wrong in above please?

Apprectiate your time.

 

 

 

 

 

 

Hi @christinek,

So you mean return specific value based on current selection? If that is the case, you can use SWITCH and SELECTEDVALUE function as following measure formula:

formula =
VAR selected =
    SELECTEDVALUE ( Table[Column] )
RETURN
    SWITCH (
        selected,
        "Business Compliance 2022", 1125,
        "Individual Returns 2022", 1947,
        "Super Fund Taxation & Accounts", 479,
        0
    )

You can use this in the card visual and it will return static values based on current selections.(notice: these can only achieve in measure formula because power bi does not support create dynamic calculate column/table based on filter selections)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Yes, works perfectly. Thank you so much Xiaoxin.

Helpful resources

Announcements
Exciting changes

Power BI Community Changes

Check out the changes to the Power BI Community announced at Build.

May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Kudo Data Story carousel

Data Stories Gallery

Visit our Data Stories Gallery and give kudos to your favorite Data Stories.

Top Solution Authors