Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have already created the following measure which gives me True/False based on what value has been chosen in the slicer (only 2 values):
selected = HASONEVALUE('Text'[Text])
In the card I have the following measure. It should show a value if the slicer choice is False and 0 if the slicer value is true:
selectedValueCard = IF ( 'Text'[selected]=False, 'Text'[My Data] , 0 )
Any idea why this isn't working? I currently get the value of 'Text'[My Data] no matter which slicer is chosen.
Here's a bit more information:
I am using a live connection to a cube. The slicer contains two different text choices, let's say A and B and this value comes from Dimension C. So I figured I could use "selected" to contain True or False depending on if A or B is chosen.
I then have "selectedValueCard" in the dimension where I have the measure I would like to show if A is selected and 0 if B is selected in the slicer.
I hope this made it a bit more clear. Sorry for the bad explaination - I'm new to Power BI!
Hi @PBNikr,
Below was the result I got based on the measures you provides. In my test, I suppose 'Text'[My Data]="Choose a value"
The measure [selected] returns false if there is nothing selected in slicer, while returns true if you make a choice.
For more advice, please share your sample data and post a screenshot of the unexpected result you have got.
Regards,
Yuliana Gu
is Text[selected] a calculated column? if so it will not relate to an slicer selection, it will just calculate the value per row
assuming in the slicer you filter Text[Text] and it's on the same table as Text[MyData], I would create following measure:
selectedValueCard = IF(HASONEVALUE(VALUES(Text[MyData])),VALUES(Text[MyData]),BLANK())
it assumues that slicer selection will always give single value from MyData
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |