Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Anonymous
Not applicable

Slicer Help

I have the following table:

Table.PNG


I want to create something like below for each green, yellow, and red values 

Color.PNG

Is is possible to create slicer like this in Power BI? 

1 ACCEPTED SOLUTION

 

Projects

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUXIvSk3NA9KRqTk5+eVARlBqCpA0MNQHIiMDQzOlWJ1oJScklRg6jIBqjUFqzcFqneGGoOswNNQ3NEAodMG0FkIaWkAtt1CKjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Project = _t, Metric1 = _t, Metric2 = _t, Metric3 = _t, StartDate = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"StartDate", type date}})
in
    #"Changed Type"

ProjectMetrics

 

let
    Source = Projects,
    #"Unpivoted Columns1" = Table.UnpivotOtherColumns(Source, {"Project", "StartDate"}, "Attribute", "Value"),
    #"Renamed Columns" = Table.RenameColumns(#"Unpivoted Columns1",{{"Attribute", "Metric"}, {"Value", "State"}})
in
    #"Renamed Columns"

projects.PNG

 

As your filtering the metric table you may need to add bidirectional filters, though this should be avoid if not need as it slows the model.

View solution in original post

4 REPLIES 4
stretcharm
Memorable Member
Memorable Member

Yes if you unpivot the data. You can then either have 2 slicers or a page level filter for each States.

 

This is the advanced editor query editor text for a sample.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUXIvSk3NA9KRqTk5+eVARlBqilKsTrSSE5IkmiKQtDNUKboikJwLunlQU2MB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Project = _t, Metric1 = _t, Metric2 = _t, Metric3 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Project", type text}, {"Metric1", type text}, {"Metric2", type text}, {"Metric3", type text}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Project"}, "Attribute", "Value"),
    #"Renamed Columns" = Table.RenameColumns(#"Unpivoted Columns",{{"Attribute", "Metric"}, {"Value", "State"}})
in
    #"Renamed Columns"

 

unpivot.PNGslicer.PNG

Anonymous
Not applicable

Thank you for your quick reply. However, I made all calculation using calculated column within my data model. Is it still possible to unpivot it within the data model? Perhaps like making a copy and unpivot?

Yes but you may need to have 2 queries one at project and one at project metric level then join these.

 

Projects

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUXIvSk3NA9KRqTk5+eVARlBqCpA0MNQHIiMDQzOlWJ1oJScklRg6jIBqjUFqzcFqneGGoOswNNQ3NEAodMG0FkIaWkAtt1CKjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Project = _t, Metric1 = _t, Metric2 = _t, Metric3 = _t, StartDate = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"StartDate", type date}})
in
    #"Changed Type"

ProjectMetrics

 

let
    Source = Projects,
    #"Unpivoted Columns1" = Table.UnpivotOtherColumns(Source, {"Project", "StartDate"}, "Attribute", "Value"),
    #"Renamed Columns" = Table.RenameColumns(#"Unpivoted Columns1",{{"Attribute", "Metric"}, {"Value", "State"}})
in
    #"Renamed Columns"

projects.PNG

 

As your filtering the metric table you may need to add bidirectional filters, though this should be avoid if not need as it slows the model.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors