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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Create a measure to return a certain value when it matches a condition

Hi all,

 

I wanted to create a measure to return the "Wait Time" value when the Store ID = National.

 

The table called ("Performance_Latest") is like:

Store ID       Wait Time

111              80%

222              90%

National      88%

 

The formula i used is:

WaitTime_National = CALCULATE(AVERAGE(Performance_Latest[Wait Time]), Performance_Latest[Store ID]="National")
 
but it didn't work and it returned blank.
 
Do you know how to fix it?
 
Thank you so much!
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , I doubt some other filter is there.

Check if this gives data. It means some other filter is there

WaitTime_National = CALCULATE(AVERAGE(Performance_Latest[Wait Time]),filter(all(Performance_Latest), Performance_Latest[Store ID]="National"))

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

4 REPLIES 4
sebastiangestia
Resolver I
Resolver I

Hello @Wenlu_Zhang,

I get the part - "National"... What do you mean?

That may be affecting, as it is a text applied to the ID for the CALCULATE.

Best regards!

AllisonKennedy
Super User
Super User

Do you have any other filters applied that could cause it to return blank?

What is the data type for Wait Time column?

Is National spelled EXACTLY the same in the table as it is in your measure?

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

You measure should work

 

Try this

 

WaitTime_National = CALCULATE(SUM(Performance_Latest[Wait Time]), Performance_Latest[Store ID]="National")

 

else are there any filters

 

Regards,

Harsh Nathani

amitchandak
Super User
Super User

@Anonymous , I doubt some other filter is there.

Check if this gives data. It means some other filter is there

WaitTime_National = CALCULATE(AVERAGE(Performance_Latest[Wait Time]),filter(all(Performance_Latest), Performance_Latest[Store ID]="National"))

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

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.