Forum Discussion
MarkCBB
9 years agoHelper V
DAX Conditional Number formatting
Hello there, Not sure if this is possible, but I would like to create a DAX measure that toggles between Currency and Whole Number. i.e. the user can use a slider to switch between viewing Unit ...
- Anonymous9 years ago
My understanding is that if you want conditional formatting, you are stuck with Strings. If you need to make numeric operations, keep the source information different to the display information. I.e. you have a Calc measure that does all of the work, and can be use by other measures further down your chain. Then have a Display measure that is simply the conditional format of your Calc.
Anonymous
9 years agoNot applicable
Hi MarkCBB,
You can create a view table to store the select item, then write a measure switch the display item based on slicer.
Table formula:
View Table = UNION(ROW("Name","Currency"),ROW("Name","Whole Number"))
Measure:
View Measure =
var selector=IF(HASONEVALUE('View Table'[Name]),VALUES('View Table'[Name]),BLANK())
return
SWITCH(selector,"Currency",[Total Units],"Whole Number",CURRENCY([Total Units]))
Regards,
Xiaoxin Sheng