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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Need to convert M query as Dax fuction code

@Jihwan_Kim@johnt75@amitchandak


Hi all,

 

Could you anybody please convert this below M query to Dax function 

Venkatesan_0-1648195276603.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Please try this.

Result_OPS = 
SWITCH(
    TRUE(),
    CONTAINS('Table','Table'[PP],'Table'[Ops],'Table'[Image  Name],'Table'[Image  Name]),"Match",
    'Table'[Ops]=BLANK(),BLANK(),
    "Not Match"
)
Result_PP = 
SWITCH(
    TRUE(),
    CONTAINS('Table','Table'[Ops],'Table'[PP],'Table'[Image  Name],'Table'[Image  Name]),"Match",
    'Table'[PP]=BLANK(),BLANK(),
    "Not Match"
)

 

vcgaomsft_0-1648603484747.png

 

Attach the PBIX file for reference. Hope it helps.

 

Best Regards,
Community Support Team_Gao

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@Anonymous ,
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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
Anonymous
Not applicable

Venkatesan_0-1648196988031.png

this is the expected output as per my requirement
There should two result "Result_OPS" and "Result_PP" 
It should compare ops value against pp value per set of image and vise versa you can find it in screen shot
I had already shared the Power query code which i can able to get the output but its not making the performance down so why i m going to dax 
PLease help to conver the Power query to Dax function 
If you need any furthur details please let me know  

Anonymous
Not applicable

Hi @Anonymous ,

 

Please create two calculated columns.

Result_OPS = 
SWITCH(
    TRUE(),
    CONTAINS('Table','Table'[PP],'Table'[Ops],'Table'[Image  Name],'Table'[Image  Name]),"Match",
    "Not Match"
)
Result_PP = 
SWITCH(
    TRUE(),
    CONTAINS('Table','Table'[Ops],'Table'[PP],'Table'[Image  Name],'Table'[Image  Name]),"Match",
    "Not Match"
)

The result is shown in the figure.

vcgaomsft_0-1648543789999.png

Attach the PBIX file for reference. Hope it helps.

 

Best Regards,
Community Support Team_Gao

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Anonymous
Not applicable

Hi ,

Thanks for your response for my post actually I need my output as shown in the below screen shot 

Venkatesan_0-1648564648416.png

actually here if you see , column PP contains 6 row of data and OPS contains 3 row of data .Our result should be of this row wise data 

For Example 

If PP columns matches with OPS columns then result should be "Match" else "Not Match"
and should have 6 result as a output,  because it contain only  6 row of data 

If OPS columns matches with PP columns then result should be "Match" else "Not Match"
and should have only 3 result as a output , because it contain only 3 row of data 

Remaining should be of "Blank" value



Anonymous
Not applicable

Hi @Anonymous ,

 

Please try this.

Result_OPS = 
SWITCH(
    TRUE(),
    CONTAINS('Table','Table'[PP],'Table'[Ops],'Table'[Image  Name],'Table'[Image  Name]),"Match",
    'Table'[Ops]=BLANK(),BLANK(),
    "Not Match"
)
Result_PP = 
SWITCH(
    TRUE(),
    CONTAINS('Table','Table'[Ops],'Table'[PP],'Table'[Image  Name],'Table'[Image  Name]),"Match",
    'Table'[PP]=BLANK(),BLANK(),
    "Not Match"
)

 

vcgaomsft_0-1648603484747.png

 

Attach the PBIX file for reference. Hope it helps.

 

Best Regards,
Community Support Team_Gao

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors
Top Kudoed Authors