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 August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Changing display text when multiple values are selected

This measure makes it so I am able to select more than one month on my report. measureexample.JPG

 

When no months are selected, however, it returns this. 

cardtest.JPG

 

Is it possible to make the card display "All Months?" 

 

I would greatly appreciate any advice. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable


@Anonymous wrote:

This measure makes it so I am able to select more than one month on my report. measureexample.JPG

 

When no months are selected, however, it returns this. 

cardtest.JPG

 

Is it possible to make the card display "All Months?" 

 

I would greatly appreciate any advice. 


Well, first of all, you should not use the automatically generated table of dates in Power BI (you should disable this option). Please do yourself a favour and create a proper date table and connect it to your fact table. If you want to have problems down the line and not know how to deal with them, you can use the automatic table but don't say I have not warned you!

 

Once you have the date table in the model connected to your fact table, you can do this:

 

[Months Visible] =
var __numberOfVisibleMonths =
	DISTINCTCOUNT( Dates[MonthShortName] )
var __allMonthsSelected =
	__numberOfVisibleMonths = 12
var __monthsVisible =
	CONCATENATEX(
		SUMMARIZE(
			Dates,
			Dates[MonthShortName],
			Dates[MonthNumberInTheYear]
		),
		Dates[MonthShortName],
		", ",
		Dates[MonthNumberInTheYear]
	)
return
	if( __allMonthsSelected,
		"All Months",
		__monthsVisible
	)

 

Your model does not look to be correctly structured. Please learn a bit about the correct design and the star schema. You'll save yourself grief and scratching your head.

 

Best

Darek

View solution in original post

3 REPLIES 3
Anonymous
Not applicable


@Anonymous wrote:

This measure makes it so I am able to select more than one month on my report. measureexample.JPG

 

When no months are selected, however, it returns this. 

cardtest.JPG

 

Is it possible to make the card display "All Months?" 

 

I would greatly appreciate any advice. 


Well, first of all, you should not use the automatically generated table of dates in Power BI (you should disable this option). Please do yourself a favour and create a proper date table and connect it to your fact table. If you want to have problems down the line and not know how to deal with them, you can use the automatic table but don't say I have not warned you!

 

Once you have the date table in the model connected to your fact table, you can do this:

 

[Months Visible] =
var __numberOfVisibleMonths =
	DISTINCTCOUNT( Dates[MonthShortName] )
var __allMonthsSelected =
	__numberOfVisibleMonths = 12
var __monthsVisible =
	CONCATENATEX(
		SUMMARIZE(
			Dates,
			Dates[MonthShortName],
			Dates[MonthNumberInTheYear]
		),
		Dates[MonthShortName],
		", ",
		Dates[MonthNumberInTheYear]
	)
return
	if( __allMonthsSelected,
		"All Months",
		__monthsVisible
	)

 

Your model does not look to be correctly structured. Please learn a bit about the correct design and the star schema. You'll save yourself grief and scratching your head.

 

Best

Darek

Anonymous
Not applicable

Thank you for the advice! I have read a bit about the star schema- I am not sure if it would work with the data I am using. It was pulled from a company ERP system and the data is essentially stacked on top of one another. I performed joins in SQL Server and transferred the file to Power BI as a single table, per my supervisor's request.

Anonymous
Not applicable

Whoever your supervisor is... he's got little idea about proper dimensional design 🙂

 

You want to know better? Go to www.sqlbi.com and read all you can read in there... Find the right articles on proper design within Power BI. Tell your supervisor as well to do the same since he has no idea what he says to you and what problems you'll have down the line with a single table design.

 

Best

Darek

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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