Forum Discussion
MONTH FILTRATION IN SLICER
Hi
I have data like this
I want to have one single slicer which should contain months from Apr TO Mar. Based on that i want to filter the records in matrix table..
If We are having a separate column for Month and months are below that, slicer works great.. But I have the data like this only..
Kindly guide me
| YEAR | SHORTNAME | DEALER | TYPE | PRODUCT | VARIANT | APR | MAY | JUN | JUL | AUG | SEP | OCT | NOV | DEC | JAN | FEB | MAR | TOTAL QTY |
| 20192020 | A | ARJUN | BS | A | 1 | 2 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | |
| 20192020 | A | ARJUN | BS | B | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | |
| 20192020 | A | ARJUN | BS | A | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | |
| 20192020 | A | ARJUN | BS | C | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | |
| 20192020 | A | ARJUN | BS | D | 3 | 0 | 2 | 2 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | |
| 20192020 | A | ARJUN | BS | E | 1 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | |
| 20192020 | A | ARJUN | BS | F | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
Hello Skarse,
you need to transform (unpivot) your table in order to achive the thing you want.
Here you can see how this would work.
BR,
Josef
If this post was helpful please share some Kudos and mark it as the solution :smileyvery-happy: Thank you very much!
4 Replies
- JosefPrakljacic
Solution Sage
Hello Skarse,
you need to transform (unpivot) your table in order to achive the thing you want.
Here you can see how this would work.
BR,
Josef
If this post was helpful please share some Kudos and mark it as the solution :smileyvery-happy: Thank you very much!
- mussaenda
Community Champion
your expected output is?
- srkase
Helper IV
i want to have a single slicer which contains all the months... now if create a slicer, i have to add 12 slicers separately for each month?
- mussaenda
Community Champion
No need to add one by one.
try this:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwtDQyMDJQ0lFyBOEgr1A/IO0UrAAFUAkQbQjERkBsgETjxrE6xJnuBDUdptOQoMmkmO6IZDpxJpNiujOa2wmHCimmu0BNN0Yy3YigLcSa7oolVqnndjfyYjUWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [YEAR = _t, SHORTNAME = _t, DEALER = _t, TYPE = _t, PRODUCT = _t, VARIANT = _t, APR = _t, MAY = _t, JUN = _t, JUL = _t, AUG = _t, SEP = _t, OCT = _t, NOV = _t, DEC = _t, JAN = _t, FEB = _t, MAR = _t]), #"Unpivoted Only Selected Columns" = Table.Unpivot(Source, {"APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC", "JAN", "FEB", "MAR"}, "Attribute", "Value"), #"Changed Type" = Table.TransformColumnTypes(#"Unpivoted Only Selected Columns",{{"Value", type number}}) in #"Changed Type"