Forum Discussion
Slicer default value
Hi good day,
Pls need help on how to set the default value on my card if non selected on my slicer, all data is in one table only. Please refer below link. what they required is the green column to be the deafult value if non selected on my slicer
https://drive.google.com/file/d/16-nb6LiROQ9vUA11ErqGamGE42ouGIA9/view?usp=sharing
Thank you
- Anonymous1 year ago
Hi AllanBerces ,
Based on the testing, try using the following dax formula.
DefaultValue = var _selected = SELECTEDVALUE('EAST AND WEST'[E&W]) RETURN IF( ISBLANK(_selected), CALCULATE(SUM('TRS'[Overall_PT_YTD])), CALCULATE(SUM('TRS'[SUM_PT_by_AREA]), 'TRS'[AREA] = SELECTEDVALUE('EAST AND WEST'[E&W])) )Then, drag the measure to the card visual.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
5 Replies
- AnonymousNot applicable
Hi AllanBerces ,
Based on the testing, try using the following dax formula.
DefaultValue = var _selected = SELECTEDVALUE('EAST AND WEST'[E&W]) RETURN IF( ISBLANK(_selected), CALCULATE(SUM('TRS'[Overall_PT_YTD])), CALCULATE(SUM('TRS'[SUM_PT_by_AREA]), 'TRS'[AREA] = SELECTEDVALUE('EAST AND WEST'[E&W])) )Then, drag the measure to the card visual.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Tutu_in_YYCSuper User
AllanBerces Does this work?
- AllanBercesPost Prodigy
Hi Tutu_in_YYC thank you very much for the reply, I change some paremeter on my data and follow your instruction. and work perfectly.
- Tutu_in_YYCSuper User
Hi, it is not clear what you are trying to achieve, can you provide more context?
You want the max/sum of Overall_Wkly_PT and Overall_PT_YTD to appear in 1 card? or 2 separate cards?
What slicer are you thnking? based on the model you have, we cant really put Overall_Wkly_PT and Overall_PT_YTD as a slicer value. But if we convert that to measures, you might be able to leverage Field Parameters
https://www.sqlbi.com/articles/fields-parameters-in-power-bi/
Here is an example (pbix attached), i created sample measures (they may not be the one you need) :
Another example, by default, only the first 2 measures appear in the card:Your default selection would be the one you pick when you save you file..
- AllanBercesPost Prodigy
Hi Tutu_in_YYC thank you for the reply basically what we trying to achieved is the value of PreviousWeek 1 and 2 from previousweek column (Week 6 & 5). when we select on the slicer let say EAST or WEST the value of column in YTD_PT_ByAREA will show on the card if non selected the value of Overall_PT_YTD will be the default and show on the card.
https://docs.google.com/spreadsheets/d/1tzzTU6LZJ8Y9NATiMWlbUgwPyN58eN4O/edit?usp=sharing&ouid=108506264278584806223&rtpof=true&sd=true
https://drive.google.com/file/d/1G0BHh6XKc1kJ8SWXhJhNEHwp5Mbk7sRu/view?usp=sharing
Thank you