Forum Discussion
IF+COUNTIF in POWERBI
Actually, I have met a problem about how to filter the special column by criterias.In Exccel,if+Countifs is easy.
City Transportation Metro?
Beijing Air Yes
Beijing Metro Yes
Beijing Train Yes
Shanghai Air Yes
Shanghai Metro Yes
Shanghai Train Yes
Nanchang Air No
Nanchang Train No
so my question is : how to get column"Metro?" by DAX functions?
2 Replies
- Zubair_Muhammad
Community Champion
Hi
You can use this calculated column in Power BI
Column = CONTAINS ( FILTER ( Table1, Table1[City] = EARLIER ( Table1[City] ) ), [Transportation], "Metro" ) - v-juanli-msft
Community Support
Hi Nightlight
As tested, Zubair_Muhammad's formula can get the expected results as the picture you provided.
Best regards
Maggie