Forum Discussion
Change value's format based on another column value
- 2 years ago
Hi fmouhcine,
This involves something like:
KPI (Display) = VAR SelKPI = SELECTEDVALUE ( Table1[KPI] ) VAR Result = SWITCH ( TRUE(), SelKPI = "Revenue", "€ " & FORMAT ( [KPI Value], "" ), SelKPI = "Volume", "€ " & FORMAT ( [KPI Value], "#,#" ), SelKPI = "Target Coverage", FORMAT ( [KPI Value], "#%" ) ) RETURN ResultYou'll have to play around with the formatting string in the second argument of the FORMAT function, but that's the rough structure that should work for what you want.
----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)P.S. Need a more in-depth consultation for your Power BI data modeling or DAX issues? Feel free to hire me on Upwork or DM me directly on here! I would love to clear up your Power BI headaches.
Hi fmouhcine,
This involves something like:
KPI (Display) =
VAR SelKPI = SELECTEDVALUE ( Table1[KPI] )
VAR Result =
SWITCH (
TRUE(),
SelKPI = "Revenue", "€ " & FORMAT ( [KPI Value], "" ),
SelKPI = "Volume", "€ " & FORMAT ( [KPI Value], "#,#" ),
SelKPI = "Target Coverage", FORMAT ( [KPI Value], "#%" )
)
RETURN Result
You'll have to play around with the formatting string in the second argument of the FORMAT function, but that's the rough structure that should work for what you want.
----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)
P.S. Need a more in-depth consultation for your Power BI data modeling or DAX issues? Feel free to hire me on Upwork or DM me directly on here! I would love to clear up your Power BI headaches.