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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
srkase
Helper IV
Helper IV

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 

YEARSHORTNAMEDEALERTYPEPRODUCTVARIANTAPRMAYJUNJULAUGSEPOCTNOVDECJANFEBMARTOTAL QTY
20192020AARJUNBS        A 1202000000005
20192020AARJUNBS        B 0010000000001
20192020AARJUNBS        A 0100000000001
20192020AARJUNBS        C 0020000000002
20192020AARJUNBS        D 3022200000009
20192020AARJUNBS        E 1200000000003
20192020AARJUNBS        F 0010000000001
1 ACCEPTED SOLUTION
JosefPrakljacic
Solution Sage
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 Smiley Very Happy Thank you very much!

 

HowToDoIt.gif

View solution in original post

4 REPLIES 4
JosefPrakljacic
Solution Sage
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 Smiley Very Happy Thank you very much!

 

HowToDoIt.gif

mussaenda
Super User
Super User

your expected output is?

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?

 

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"

2019_08_31_15_59_07_Settings.png

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.