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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
abhirami_rs091
New Member

Value for last month of Quarter for multiple selection

Hello !

I would like to get the value against latest/last month of a quarter if "Quarter filter"  alone is selected. If both Quarter and Month filters are selected then give the value for selected month. If multiple values are selected in month( say jan and may) return value for May. Similarly if multiple Quarters are selected, then the last month of the latest quarter. (say if Q1 and Q2, the return for June unless any other month is selected explicitly)

 

Any help is appreciated. 

Thanks alot for your time! 

1 ACCEPTED SOLUTION
Martin_D
Super User
Super User

Hi @abhirami_rs091 ,

 

Lets assume you have a Date table with columns Date[Quarter], Date[Month] (the abbreviated month name) and Date[Month Order] (a column to sort column Date[Month] chronologically) and a measure called [Value] that you want to calculate for the selected period.

 

Then a measure could look like this

 

Selected Period Calculation =
IF (

    ISFILTERED ( Date[Month] ),
    VAR _ShowMonth = MAX(Date[Month Order])
    RETURN
    CALCULATE (
        [Value],

        Date[Month Order] = _ShowMonth

    ),

    VAR _ShowQuarter = MAX(Date[Quarter])
    RETURN

    CALCULATE (
        [Value],

        Date[Quarter] = _ShowQuarter

    )
)

 

Kind regards,
Martin


    

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @abhirami_rs091 ,

Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.

If these also don't help, please share more detailed information and description to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Martin_D
Super User
Super User

Hi @abhirami_rs091 ,

 

Lets assume you have a Date table with columns Date[Quarter], Date[Month] (the abbreviated month name) and Date[Month Order] (a column to sort column Date[Month] chronologically) and a measure called [Value] that you want to calculate for the selected period.

 

Then a measure could look like this

 

Selected Period Calculation =
IF (

    ISFILTERED ( Date[Month] ),
    VAR _ShowMonth = MAX(Date[Month Order])
    RETURN
    CALCULATE (
        [Value],

        Date[Month Order] = _ShowMonth

    ),

    VAR _ShowQuarter = MAX(Date[Quarter])
    RETURN

    CALCULATE (
        [Value],

        Date[Quarter] = _ShowQuarter

    )
)

 

Kind regards,
Martin


    

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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