Forum Discussion
palmeirense_
4 years agoFrequent Visitor
Format loss when unpivoting columns
I am working on a report where in the source file, I have a set of columns expressed in different format types (a few are percentages, some are currency, others are fixed decimal number). Because my...
v-angzheng-msft
4 years agoCommunity Support
Hi, palmeirense_
You can use Switch function and format function to help you
When you unpivot the columns, you get an attribute column.
Create a measure like below
_Switch =
SWITCH(
SELECTEDVALUE('Table'[Attribute]),
"Percentage",FORMAT(SELECTEDVALUE('Table'[Value]),"Percent"),//columnName1
"Currency", FORMAT(SELECTEDVALUE('Table'[Value]),"Currency"),//columnName2
"Decimal number", FORMAT(SELECTEDVALUE('Table'[Value]),"Fixed"))//columnName3
Result:
Please refer to the attachment below for details.
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.