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.
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]) & "","...")
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 |
---|---|
110 | |
94 | |
81 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |