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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
unnijoy
Post Prodigy
Post Prodigy

Dynamic Title

I want to create a Dynamic title based on the month that am selecting. Condetions are below

 

1 If am selecting All Months then it should show "MTD".

2 If am selecting multiple month's then it should show "Multiple Month's".

3 If am selecting only one month then it should show "MTD".

1 ACCEPTED SOLUTION

@unnijoy  I think I forgot to close ) before =1

 

SWITCH(TRUE(),
NOT(ISFILTERED('Month DB'[Month])),"MTD",
ISFILTERED('Month DB'[Month])&&CALCULATE(DISTINCTCOUNT('Month DB'[Month]),ALLSELECTED('Month DB'[Month]))=1,"MTD","Multiple Month's")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@unnijoy , Create measure like

 

Switch ( True() ,
not(isfiltered(Date[Month]) ) , "MTD",
isfiltered(Date[Month]) && countx(allselected(Date), Date[month]) =1, "MTD",
"Multiple Months"
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak ,

 

If all months are seleced the title is changing to MTD. But if  i select any one month it is changin to "Multiple Months".

 

How to fix it. Please help. 

@unnijoy , I think for all month you needed MTD, First condition is for that. I changed the second one 

 

Switch ( True() ,
not(isfiltered(Date[Month]) ) , "MTD", // Change this when nothing is selected or all selected 
isfiltered(Date[Month]) && calculate(distinctCOUNT( Date[month]),allselected(Date)) =1, "MTD",
"Multiple Months"
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak ,

 

the is how i use the code.

SWITCH(TRUE(),
NOT(ISFILTERED('Month DB'[Month])),"MTD",
ISFILTERED('Month DB'[Month])&&CALCULATE(DISTINCTCOUNT('Month DB'[Month]),ALLSELECTED('Month DB'[Month])=1,"MTD","Multiple Month's")

 

I am gettin the below error.

 

"The True/False expressions does not specify a column . Each True/False expressions used as a table filter expression must refer to excatly one column".

@unnijoy  I think I forgot to close ) before =1

 

SWITCH(TRUE(),
NOT(ISFILTERED('Month DB'[Month])),"MTD",
ISFILTERED('Month DB'[Month])&&CALCULATE(DISTINCTCOUNT('Month DB'[Month]),ALLSELECTED('Month DB'[Month]))=1,"MTD","Multiple Month's")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

hi @amitchandak ,

 

You are amazing. Thanks a lot. It's working

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.