cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
datadad84 Advocate III
Advocate III

How to Filter Time Series Data in Columns

I have this time series data that I would like to be able to filter on the column names in a slicer.

time.series.plot.jpg

Is there a measure I can create that provides a list of the column names? I'd like to have a drop down list of the different columns.

 

thank you for any help.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: How to Filter Time Series Data in Columns

Hi datadad84,

If you want to slicer based on column name , you could try to modify data structure to unpivot column like below

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlTSUTI0BRIgbKIUqxOtlAQSMgIRBkDCGCyWDOIaAwlzIDZSio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [name = _t, c1 = _t, c2 = _t, c3 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"name", type text}, {"c1", Int64.Type}, {"c2", Int64.Type}, {"c3", Int64.Type}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"name"}, "Attribute", "Value")
in
    #"Unpivoted Columns"

 Or you could create a new table with column name in it(use this in slicer), then you need to create measure for each column (m1,m2,m3), then use below meausre to see whether it work or not

= switch(TRUE(),SELECTEDVALUE('Table'[name])="a", m1, SELECTEDVALUE('Table'[name])="b", m2)

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support
Community Support

Re: How to Filter Time Series Data in Columns

Hi datadad84,

If you want to slicer based on column name , you could try to modify data structure to unpivot column like below

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlTSUTI0BRIgbKIUqxOtlAQSMgIRBkDCGCyWDOIaAwlzIDZSio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [name = _t, c1 = _t, c2 = _t, c3 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"name", type text}, {"c1", Int64.Type}, {"c2", Int64.Type}, {"c3", Int64.Type}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"name"}, "Attribute", "Value")
in
    #"Unpivoted Columns"

 Or you could create a new table with column name in it(use this in slicer), then you need to create measure for each column (m1,m2,m3), then use below meausre to see whether it work or not

= switch(TRUE(),SELECTEDVALUE('Table'[name])="a", m1, SELECTEDVALUE('Table'[name])="b", m2)

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

datadad84 Advocate III
Advocate III

Re: How to Filter Time Series Data in Columns

I solved this issue by 'unpivotiing' the columns in the query editor 

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors