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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
nleuck_101
Resolver III
Resolver III

Slicer 0-3, 3-6, 6-9, 9-12 months in Power BI

Hello All,

 

I need some help coming up with a way to create a slicer that groups months similar to:

 

0-3

3-6

6-9

9-12

 

I'm not sure this is possible but I thought I've seen it done before but can't find an article that explains how to do that. Any help would be greatly appreciated.

 

Thanks!

1 ACCEPTED SOLUTION

@nleuck_101,

 

Try this calculated column in your date table:

 

Month Group = 
VAR vMonth = Dates[Month Number]
VAR vResult =
    SWITCH (
        TRUE (),
        vMonth >= 1
            && vMonth <= 3, "1-3",
        vMonth >= 4
            && vMonth <= 6, "4-6",
        vMonth >= 7
            && vMonth <= 9, "7-9",
        vMonth >= 10
            && vMonth <= 12, "10-12"
    )
RETURN
    vResult




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
wright2fish
Frequent Visitor

I have a similiar situation.  I have a date column for construction start.  I then created another column from construction start that shows me months from today until construction start.  I then created another column form that months column showing rnages similiar to this thread 0-3,4-6,7-9,10-12 and 1yr+.  I am trying to show on my visual a project look ahead from a chiklet slicer showing the date ranges which I did but only shows the date ranges on whatever one I click on.  I want 0-3 to only show projects within that range, 4-6 to show all of 0-3 projects plus 4-6, and so on.  Any ideas?

parry2k
Super User
Super User

@nleuck_101 same solution as @DataInsights  but you can make it little simple

 

Month Group = 
VAR vMonth = Dates[Month Number]
VAR vResult =
    SWITCH (
        TRUE (),
        vMonth >= 10, "10-12"
        vMonth >= 7, "7-9",
        vMonth >= 4, "4-6",
        "1-3"
)
RETURN
    vResult

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

 

Check my latest video on Filters and Sparklines https://youtu.be/wmwcX8HvNxc

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

nleuck_101
Resolver III
Resolver III

This is my original post that got marked as spam. Any help would be greatly appreciated in regards to the slicer.

@nleuck_101,

 

Try this calculated column in your date table:

 

Month Group = 
VAR vMonth = Dates[Month Number]
VAR vResult =
    SWITCH (
        TRUE (),
        vMonth >= 1
            && vMonth <= 3, "1-3",
        vMonth >= 4
            && vMonth <= 6, "4-6",
        vMonth >= 7
            && vMonth <= 9, "7-9",
        vMonth >= 10
            && vMonth <= 12, "10-12"
    )
RETURN
    vResult




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




That was correct ? Because that was no data show in my visiual
 
 
expired date with month = SWITCH(
    TRUE(),
    FDA[Expired date]="<0", "Almost Expired",
    FDA[Expired date]="0-90", "0-3months",
    FDA[Expired date]="91-180", "3-6months",
    FDA[Expired date]="181-365", "1yr",
    FDA[Expired date]=">365", ">1yr")

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.