Forum Discussion
akhilduvvuru
Helper IV
3 years agoFormat Error while displaying numbers and percentages at same time in a table
Hi Team, I have a reqirement to show both numbers and percentages in same column using a measure as below: I wrote a switch statement in measure Measure =
VAR _Cat = SELEECTEDVALUE(CATEGORY)
V...
- 3 years ago
Hi akhilduvvuru ,
As a workaround, please try following steps.
This is my test table:
Create a new column:
Column = VAR _a = 'Table'[SALES] * 100 VAR _b = IF ( 'Table'[CATEGORY] = "Total %", _a, 'Table'[SALES] ) VAR _c = CONVERT ( _b, STRING ) RETURN IF ( 'Table'[CATEGORY] = "Total %", _c & "%", _c )You will get a column like this:
I think this is the result you want:
Please refer the attached pbix file.
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yadongf-msft
Community Support
3 years agoHi akhilduvvuru ,
As a workaround, please try following steps.
This is my test table:
Create a new column:
Column =
VAR _a = 'Table'[SALES] * 100
VAR _b =
IF ( 'Table'[CATEGORY] = "Total %", _a, 'Table'[SALES] )
VAR _c =
CONVERT ( _b, STRING )
RETURN
IF ( 'Table'[CATEGORY] = "Total %", _c & "%", _c )
You will get a column like this:
I think this is the result you want:
Please refer the attached pbix file.
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.