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

Get certified as a Fabric Data Engineer: Check your eligibility for a 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700. Get started

Reply
Raman3456
Helper II
Helper II

Need to Show the Quarter Visuals

Dear Team,

 

My Requirment is 

 

Jan

Feb

Mar

Apr

May

Jun

Jul

Aug

Sep

Oct

 

I am having one Slicer Quarter and Year 

 

a)  If i select Jan in Slicer -----  Visual should show Jan month sales 

b) If I slect Feb in Slicer ------ Visual should show Jan and Feb month sales in Graph

 

Apppreicate the help .

 

I Can able to send a file if you provide any link.

 

Thanks

Raman

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

Hi @Raman3456 ,

 

I think you want to display the sales for January when you select January in the slicer. When February is selected, the sales for January and February are displayed. When June is selected, the sales for April, May and June are displayed.

 

Here's my solution.

Sample data

vstephenmsft_0-1640757868644.png

 

1.Create a calendar table.

Calendar = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))

vstephenmsft_1-1640757904854.png

There's no relationship between tables.

vstephenmsft_2-1640757912056.png

 

2.Create a flag measure.

Flag = 
VAR _selmonth =
    SELECTEDVALUE ( 'Calendar'[Date].[MonthNo] )
VAR _minmonth =
    SWITCH (
        _selmonth,
        1, 1,
        2, 1,
        3, 1,
        4, 4,
        5, 4,
        6, 4,
        7, 7,
        8, 7,
        9, 7,
        10, 10,
        11, 10,
        12, 10
    )
VAR _month =
    MONTH ( MAX ( 'Table'[Date] ) )
RETURN
    IF (
        _month >= _minmonth
            && _month <= _selmonth
            && YEAR ( MAX ( 'Table'[Date] ) ) = SELECTEDVALUE ( 'Calendar'[Date].[Year] ),
        1
    )

Put this measure into visual level filters. Then set show items when the value is 1.

vstephenmsft_3-1640757993749.png

3.Put the year and month hierarchy in the calendar table into the slicer, and the results is as follows.

vstephenmsft_4-1640758040558.png

vstephenmsft_5-1640758048105.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

4 REPLIES 4
v-stephen-msft
Community Support
Community Support

Hi @Raman3456 ,

 

I think you want to display the sales for January when you select January in the slicer. When February is selected, the sales for January and February are displayed. When June is selected, the sales for April, May and June are displayed.

 

Here's my solution.

Sample data

vstephenmsft_0-1640757868644.png

 

1.Create a calendar table.

Calendar = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))

vstephenmsft_1-1640757904854.png

There's no relationship between tables.

vstephenmsft_2-1640757912056.png

 

2.Create a flag measure.

Flag = 
VAR _selmonth =
    SELECTEDVALUE ( 'Calendar'[Date].[MonthNo] )
VAR _minmonth =
    SWITCH (
        _selmonth,
        1, 1,
        2, 1,
        3, 1,
        4, 4,
        5, 4,
        6, 4,
        7, 7,
        8, 7,
        9, 7,
        10, 10,
        11, 10,
        12, 10
    )
VAR _month =
    MONTH ( MAX ( 'Table'[Date] ) )
RETURN
    IF (
        _month >= _minmonth
            && _month <= _selmonth
            && YEAR ( MAX ( 'Table'[Date] ) ) = SELECTEDVALUE ( 'Calendar'[Date].[Year] ),
        1
    )

Put this measure into visual level filters. Then set show items when the value is 1.

vstephenmsft_3-1640757993749.png

3.Put the year and month hierarchy in the calendar table into the slicer, and the results is as follows.

vstephenmsft_4-1640758040558.png

vstephenmsft_5-1640758048105.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.

 

 

parry2k
Super User
Super User

@Raman3456 if you have multiple years data, selecting a month doesn't tell you a quarter of which years you are looking at? Isn't it?



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.

parry2k
Super User
Super User

@Raman3456 When you are working with dates, it is a best practice to add a date dimension in your model, you can add one by following my post here, once it is done then you can add the following measure to get QTD sales

 

QTD Sales = CALCULATE ( SUM ( Table[Sales] ), DATESQTD ( 'Date Table'[Date] ) )

 

 

Follow us on LinkedIn

 

Learn about conditional formatting at Microsoft Reactor

My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) 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.

Hi Parry,

Thanks for the Prompt reply .

Raman3456_0-1640534726831.png

Unable to see January and Febraury , I have selected the February data.

 

Thanks & Regards,

Raman

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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