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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Madhura29
Frequent Visitor

Advanced Slicer filtering months

Hello Folks ! Please help me with the following doubt !

 

I have a slicer which filters Months. I want the output on barchart such as :- If I select June, Bar chart should show me the Month - March, April, May, June, July, Aug, Sept, December, June Previous Year and December Previous Year.

 

Thank you in advance.

1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @Madhura29 ,

 

You can create a seperate table with month name, then create the specified measure like

Measure = 
IF (
    ISFILTERED ( MonthName[Month] ),
    SWITCH (
        SELECTEDVALUE ( MonthName[Month] ),
        "June",
            CALCULATE (
                SUM ( 'Table'[Value] ),
                FILTER (
                    'Table',
                    (
                        [Date] < DATE ( YEAR ( TODAY () ), 10, 1 )
                            && [Date] >= DATE ( YEAR ( TODAY () ), 3, 1 )
                    )
                        || (
                            [Date] >= DATE ( YEAR ( TODAY () ), 12, 1 )
                                && [Date] <= DATE ( YEAR ( TODAY () ), 12, 31 )
                        )
                        || (
                            [Date]
                                >= DATE ( YEAR ( TODAY () ) - 1, 6, 1 )
                                && [Date]
                                    <= DATE ( YEAR ( TODAY () ) - 1, 6, 30 )
                        )
                        || (
                            [Date]
                                >= DATE ( YEAR ( TODAY () ) - 1, 12, 1 )
                                && [Date]
                                    <= DATE ( YEAR ( TODAY () ) - 1, 12, 31 )
                        )
                )
            )
    ),
    SUM ( 'Table'[Value] )
)

10.png

 

 

Best Regards,

Stephen Tao

 

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
v-stephen-msft
Community Support
Community Support

Hi @Madhura29 ,

 

You can create a seperate table with month name, then create the specified measure like

Measure = 
IF (
    ISFILTERED ( MonthName[Month] ),
    SWITCH (
        SELECTEDVALUE ( MonthName[Month] ),
        "June",
            CALCULATE (
                SUM ( 'Table'[Value] ),
                FILTER (
                    'Table',
                    (
                        [Date] < DATE ( YEAR ( TODAY () ), 10, 1 )
                            && [Date] >= DATE ( YEAR ( TODAY () ), 3, 1 )
                    )
                        || (
                            [Date] >= DATE ( YEAR ( TODAY () ), 12, 1 )
                                && [Date] <= DATE ( YEAR ( TODAY () ), 12, 31 )
                        )
                        || (
                            [Date]
                                >= DATE ( YEAR ( TODAY () ) - 1, 6, 1 )
                                && [Date]
                                    <= DATE ( YEAR ( TODAY () ) - 1, 6, 30 )
                        )
                        || (
                            [Date]
                                >= DATE ( YEAR ( TODAY () ) - 1, 12, 1 )
                                && [Date]
                                    <= DATE ( YEAR ( TODAY () ) - 1, 12, 31 )
                        )
                )
            )
    ),
    SUM ( 'Table'[Value] )
)

10.png

 

 

Best Regards,

Stephen Tao

 

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

amitchandak
Super User
Super User

@Madhura29 , You need to create the bar visual on an independent date table. based on that you can have more dates on the other selected visual

 

explained similar stuff here - Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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