Forum Discussion
Syndicate_Admin
4 years agoAdministrator
Multi-format numbers in the same column
Dear community very good afternoon, I have the following problem: I have a numeric type column called Value Month, what I need is for the prensentaod value in the table to have its corresponding for...
- 4 years ago
Hi
Try like below.
Result =
VAR _Type =
SELECTEDVALUE ( 'Table'[Type] )
VAR _value =
SUM ( 'Table'[Value] )
RETURN
SWITCH (
TRUE (),
CONTAINSSTRING ( _Type, "$" ), FORMAT ( _value, "$ #,00" ),
CONTAINSSTRING ( _Type, "Days" ), FORMAT ( _value, "#,00" ),
CONTAINSSTRING ( _Type, "%" ), FORMAT ( _value, "#.00 %" )
)Thanks
Hari
Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.
My Blog :: YouTube Channel :: My Linkedin
Hariharan_R
4 years agoSolution Sage
Hi
Try like below.
Result =
VAR _Type =
SELECTEDVALUE ( 'Table'[Type] )
VAR _value =
SUM ( 'Table'[Value] )
RETURN
SWITCH (
TRUE (),
CONTAINSSTRING ( _Type, "$" ), FORMAT ( _value, "$ #,00" ),
CONTAINSSTRING ( _Type, "Days" ), FORMAT ( _value, "#,00" ),
CONTAINSSTRING ( _Type, "%" ), FORMAT ( _value, "#.00 %" )
)
Thanks
Hari
Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.
My Blog :: YouTube Channel :: My Linkedin
If I helped you, click on the Thumbs Up to give Kudos.
My Blog :: YouTube Channel :: My Linkedin
- Anonymous3 years agoNot applicable
tried switch function in my report page did not get the result . used new column write the following
SWITCH(
TRUE(),MLayout[name] = "Revenue", [Revenue],MLayout[name] = "Gros Profit", [GP],MLayout[name] = "Gros Margin",FORMAT([GP Margin],"#.00 %"))error message " expression that yield variant data-type can not be used to define calculated columns"