The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I would like to show a value in a card visual only when one row is selected. If more rows are selected I want to show "...".
The value I want to show is a date.
With dax I made the following code: DateSV = SELECTEDVALUE(table[date], "...")
If multiple rows are selected, the dax works. The card visual neatly shows "...". But when I select one row, "#,0.00" appears in the card visual.
Who can help me to optimize my dax code?
Solved! Go to Solution.
Hi @henriwestra ,
Please follow these steps to create a measure:
1. input
Measure 2 = SELECTEDVALUE('Table'[Date])
2.Change its' format as Date format(Short Date)
3. Modify the measure:
Measure 2=
var _count=COUNTX(ALLSELECTED('Table'),[Date])
var _sele=SELECTEDVALUE('Table'[Date])
return IF(_count=1,_sele,"...")
Here is the final output:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @henriwestra ,
Please follow these steps to create a measure:
1. input
Measure 2 = SELECTEDVALUE('Table'[Date])
2.Change its' format as Date format(Short Date)
3. Modify the measure:
Measure 2=
var _count=COUNTX(ALLSELECTED('Table'),[Date])
var _sele=SELECTEDVALUE('Table'[Date])
return IF(_count=1,_sele,"...")
Here is the final output:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
DateSV =
format(
coalesce(
selectedvalue( 'table'[Date] ),
"..."
),
"yyyy-MM-dd" // you can adjust this
)
@henriwestra Easiest solution:
DateSV2 = IF(HASONEVALUE('Calendar'[Date]),MAX('Calendar'[Date]) & "","...")