Forum Discussion

uscartjoy's avatar
uscartjoy
Frequent Visitor
3 years ago
Solved

Power BI Parameter Field Dynamic Slicer and Custom Conditional Formatting Based on Dynamic Slicer

I have data that measures various Performance Indicators.  I created Parameter Fields to create slicers which will change my charts based on the Performance Indicator Chosen.  This is my chart which ...
  • uscartjoy's avatar
    3 years ago

    I was actually able to get the coloring to work by doing the following:

     
    Selected Measure = maxx(FILTER('Measure Slicer Table', 'Measure Slicer Table'[Parameter Order] = SELECTEDVALUE('Measure Slicer Table'[Parameter Order])), 'Measure Slicer Table'[Parameter])
     
    Then the following:
    Selected Line Measure Color = Switch([Selected Measure],
        "AI %", SWITCH(TRUE(), [Asset Intensity Total (%)]>=AVERAGE('Targets Line Glidepath'[AI 100]), "#04B430", [Asset Intensity Total (%)]<AVERAGE('Targets Line Glidepath'[AI 100]), "#ff3300"),
        "Efficiency %", SWITCH(TRUE(), [Efficiency Total (%)]>=AVERAGE('Targets Line Glidepath'[Efficiency 100]), "#04B430", [Efficiency Total (%)]<AVERAGE('Targets Line Glidepath'[Efficiency 100]), "#ff3300"),
        "eUPS %", SWITCH(TRUE(), [Estimated Unplanned Stoppages Time Total (%)]>=AVERAGE('Targets Line Glidepath'[OPS 100]), "#ff3300", [Estimated Unplanned Stoppages Time Total (%)]<AVERAGE('Targets Line Glidepath'[OPS 100]), "#04B430"),
        "Breakdown %", SWITCH(TRUE(), [Breakdown Time Total (%)]>=AVERAGE('Targets Line Glidepath'[Breakdown]), "#ff3300", [Breakdown Time Total (%)]<AVERAGE('Targets Line Glidepath'[Breakdown]), "#04B430"),
        "Minor Stops %", SWITCH(TRUE(), [Minor Stop Time Total (%)]>=AVERAGE('Targets Line Glidepath'[MS]), "#ff3300", [Minor Stop Time Total (%)]<AVERAGE('Targets Line Glidepath'[MS]), "#04B430"))
     
    However, it only works so far with the "week" timeframe view.  I need it to work with all.
     
    Weeks are Working for all Indicators