The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi Experts,
I have a requirement to display the selected value in a card and for that I'm using DAX function "Selectedvalue".
When ever I select something in slicer that is reflecting in my card and when I clearmy selection it is displaying Blank.
Now my requirement is to display "ALL" instead of blank when we don't select anything in slicer.
I have created a measure using formula Measure=Selectedvalue('Table Name'[Column name])
Can any one suggest me how can I acheive this.
Thanks,
Anand
Solved! Go to Solution.
@AnandNamburi , try like
if(isfiltered('Table Name'[Column name]), Selectedvalue('Table Name'[Column name]), "All")
or
if(isfiltered('Table Name'[Column name]), Selectedvalue('Table Name'[Column name]) & "" , "All")
This measure count the selected user if multiple or the user name if only one selected. You can adapt it to your case
Measure =
VAR __DISTINCT_VALUES_COUNT = DISTINCTCOUNT('Table'[user])
VAR __MAX_VALUES_TO_SHOW = 1
RETURN
IF(
__DISTINCT_VALUES_COUNT > __MAX_VALUES_TO_SHOW,
__DISTINCT_VALUES_COUNT & " selected users"
,
CONCATENATEX(
VALUES('Table'[user]),
'Table'[user],
"",
'Table'[user],
ASC
)
)
@AnandNamburi , try like
if(isfiltered('Table Name'[Column name]), Selectedvalue('Table Name'[Column name]), "All")
or
if(isfiltered('Table Name'[Column name]), Selectedvalue('Table Name'[Column name]) & "" , "All")