Forum Discussion
Row Value Formatting
- 5 months ago
1) Keep your measure returning the numeric value only
Target Value = SUM(Target[Target])2) Create a format expression for the measure
In Model view → select the measure → Format → Dynamic, use something like:
VAR _SelectedKPI = SELECTEDVALUE(Target[Target]) RETURN SWITCH( _SelectedKPI, "TotalLoads", "#,#", "Outbound", "#,#", "Miles", "#,#", "MiLoad", "#,#", "DrvHours", "#,#.00", "StandardMPH", "#,#.00", "MPH", "#,#.00", "StandardHrsLoad", "#,#.00", "HrsLoad", "#,#.00", "MSF", "#,#", "MSFLoad", "#,#.0", "LowMSF", "#,#", "PctLowMSF", "0.0%", "Fixed", "$#,#0", "HourCharge", "$#,#0", "DrvHourCharge", "$#,#0", "Other", "$#,#0", "FSC", "$#,#0", "TotalCharge", "$#,#0", "CostMSF", "$#,#0.00", "CostLoad", "$#,#0.00", "CostMile", "$#,#0.00", "CostHour", "$#,#0.00", "SpotHours", "#,#", "SpotHourCharge", "$#,#0", "SpotTractor", "$#,#0", "TotalSpot", "$#,#0", "GrandTotalCharge", "$#,#0", "All In Cost/MSF", "$#,#0.00", "CostMSF13", "$#,#0.00", "ALL_IN_COSTMSF13", "$#,#0.00" )
1) Keep your measure returning the numeric value only
Target Value =
SUM(Target[Target])
2) Create a format expression for the measure
In Model view → select the measure → Format → Dynamic, use something like:
VAR _SelectedKPI = SELECTEDVALUE(Target[Target])
RETURN
SWITCH(
_SelectedKPI,
"TotalLoads", "#,#",
"Outbound", "#,#",
"Miles", "#,#",
"MiLoad", "#,#",
"DrvHours", "#,#.00",
"StandardMPH", "#,#.00",
"MPH", "#,#.00",
"StandardHrsLoad", "#,#.00",
"HrsLoad", "#,#.00",
"MSF", "#,#",
"MSFLoad", "#,#.0",
"LowMSF", "#,#",
"PctLowMSF", "0.0%",
"Fixed", "$#,#0",
"HourCharge", "$#,#0",
"DrvHourCharge", "$#,#0",
"Other", "$#,#0",
"FSC", "$#,#0",
"TotalCharge", "$#,#0",
"CostMSF", "$#,#0.00",
"CostLoad", "$#,#0.00",
"CostMile", "$#,#0.00",
"CostHour", "$#,#0.00",
"SpotHours", "#,#",
"SpotHourCharge", "$#,#0",
"SpotTractor", "$#,#0",
"TotalSpot", "$#,#0",
"GrandTotalCharge", "$#,#0",
"All In Cost/MSF", "$#,#0.00",
"CostMSF13", "$#,#0.00",
"ALL_IN_COSTMSF13", "$#,#0.00"
)
I tried this, but the format logic won't save when I change to format and dynamic. Is there a reason for this?
This is what happens when I hit enter to save the logic that was entered.
- danextian5 months agoSuper User
You could create a separate measure and use that measure as format string.
- cheid5 months agoFrequent Visitor
I have tried everyone's suggestions and nothing is working (see current state screenshot). The only thing I haven't mentioned and I wasn't sure if this made a difference is under transformation I unpivot the main fact data table (see below) so I could create a relationship between fact table attributes and Target Measures. I then was able to put the target values under "Rows" when I built the matrix (see current state table). Can this make a difference when trying to format the target values? Thanks.
Target Table
Main Fact Table
Relationship
Current State of Target Values
- MasonMA5 months agoSuper User
It looks the format logic references the wrong column (Target), instead of the KPI identifier (Measure).
Try using format logic based on the 'KPI' name and referencing SELECTEDVALUE('Table'[Measure]).