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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
AlanP514
Post Patron
Post Patron

Dynamic Title Measure

Here i need to Create one dax title measure

Now the year is 2023 IS SELECTED and month is Dec

So total we have 4 Quarter

 

I need to create one dax measure and it should be a dynamic

 

Use case

 

If the year 2022 is selected and Month is December I need to create one dax measure output "Q3" (it should be Dynamic Ie one quarter less that means from month selection if i select again september i need to show Q2 as output )

 

 

Expected end outPut should be like

 

"Sales Q3 with sales Selected Month (Decemeber 22)"
Here i am attaching the pbix file 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @AlanP514 ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create a measure.

Measure = "Sales"&" "&"Q"&QUARTER(EOMONTH(MAX(Dim_Calendar[Date]),-3))&" "&"with"&" "&"sales"&" "&"Selected Month"&" "&MAX(Dim_Calendar[Month Name])&" "&MAX(Dim_Calendar[Year])

(3) Then the result is as follows.

vtangjiemsft_0-1676618420540.png

Best Regards,

Neeko Tang

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
shrabedi
Frequent Visitor

Hi @AlanP514 

I have tweaked @Anonymous DAX a little bit because I was facing a problem using that.

I added another measure to it.

Measure = "Sales"&" "&""&[Quarter Name Measure]&" "&"with"&" "&"sales"&" "&"Selected Month"&" "&MAX(Dim_Calendar[Month Name])&" "&MAX(Dim_Calendar[Year])

The following measure I made and called in the above measure.

Quarter Name Measure = 
VAR SelectedMonth = SWITCH(MAX(Dim_Calendar[Month Name]), 
    "January", 1, 
    "February", 2, 
    "March", 3, 
    "April", 4, 
    "May", 5, 
    "June", 6, 
    "July", 7, 
    "August", 8, 
    "September", 9, 
    "October", 10, 
    "November", 11, 
    "December", 12
)
RETURN
IF(
    SelectedMonth >= 1 && SelectedMonth <= 3,
    "Q4",
    IF(
        SelectedMonth >= 4 && SelectedMonth <= 6,
        "Q1",
        IF(
            SelectedMonth >= 7 && SelectedMonth <= 9,
            "Q2",
                IF(SelectedMonth >= 10 && SelectedMonth <= 12,"Q3")
            
        )
    )
)


1.PNG2.PNG3.PNG4.PNG
Anonymous
Not applicable

Hi @AlanP514 ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create a measure.

Measure = "Sales"&" "&"Q"&QUARTER(EOMONTH(MAX(Dim_Calendar[Date]),-3))&" "&"with"&" "&"sales"&" "&"Selected Month"&" "&MAX(Dim_Calendar[Month Name])&" "&MAX(Dim_Calendar[Year])

(3) Then the result is as follows.

vtangjiemsft_0-1676618420540.png

Best Regards,

Neeko Tang

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.