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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Anonymous
Not applicable

DAX Measure error using contains

Hi Experts

 

Cannot see my error with the following measure when using contains in a DAX Measure

Days Used =

If('FACT_Scheduler Data_All'[Name] = "John" && contains('FACT_Scheduler Data_All','FACT_Scheduler Data_All'[Subject],"OOO"),0,

If('FACT_Scheduler Data_All'[Name] = "John" && 'FACT_Scheduler Data_All'[Subject] = "Unavailable",0)))

column [Subject] has the following text OOO thrusday & friday

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , That is fine as a column, not as measure.

 

For measure you try like

 

Days Used =

If(max('FACT_Scheduler Data_All'[Name]) = "John" && contains('FACT_Scheduler Data_All',max('FACT_Scheduler Data_All'[Subject]),"OOO"),0,

If(max('FACT_Scheduler Data_All'[Name]) = "John" && max('FACT_Scheduler Data_All'[Subject]) = "Unavailable",0))

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

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , That is fine as a column, not as measure.

 

For measure you try like

 

Days Used =

If(max('FACT_Scheduler Data_All'[Name]) = "John" && contains('FACT_Scheduler Data_All',max('FACT_Scheduler Data_All'[Subject]),"OOO"),0,

If(max('FACT_Scheduler Data_All'[Name]) = "John" && max('FACT_Scheduler Data_All'[Subject]) = "Unavailable",0))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi Amit.....Error on my part its a caculated column measure.....sorry

Hi, @Anonymous 

Not sure what you mean by 'caculated column measure'.

If your problem has been solved, you could accept the helpful answer as solution to close this thread. 

It will help other community members easily find the solution when they get the similar issue.

 

Best Regards,
Community Support Team _ Eason

 

 

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors