Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have a slicer, which has 3 possible values, taken from 'Region' column in my data set.
I have a card that has 'Region' as its value. Each time a region is selected in the slicer, it updates the card.
I want to create a measure that (logically) reads like this:
Measure = IF('Region'=Blank,"Global",'Region')
In other words, if the slicer containing 'Region' has nothing selected I want the measure to display the value 'Global'. Once a region is selected, the card displays the selected region.
Is this possible?
Thanks in advance
Solved! Go to Solution.
Try this, if one region selected, it will give the name of the region, if none is selected or more than one selected, it will say "Global"
You have to think what you want to say in case more than one region is selected , basically out of 3 you listed, user selects 2, what you want to call it, GLOBAL? I didn't consider that in following DAX.
Measure Region = IF ( HASONEVALUE( Table[Region] ), VALUES( Table[Region]), "GLOBAL" )
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
You can do this by using ISFILTERED Function
Dynamic Region Value = SWITCH(TRUE(), ISFILTERED(Sheet1[Region]),SELECTEDVALUE(Sheet1[Region]), "Global" )
OR Dynamic Region Value = IF(ISFILTERED(Sheet1[Region]),SELECTEDVALUE(Sheet1[Region]),"Global")
Try this, if one region selected, it will give the name of the region, if none is selected or more than one selected, it will say "Global"
You have to think what you want to say in case more than one region is selected , basically out of 3 you listed, user selects 2, what you want to call it, GLOBAL? I didn't consider that in following DAX.
Measure Region = IF ( HASONEVALUE( Table[Region] ), VALUES( Table[Region]), "GLOBAL" )
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
User | Count |
---|---|
76 | |
75 | |
46 | |
31 | |
27 |
User | Count |
---|---|
99 | |
89 | |
52 | |
48 | |
46 |