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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Mystery
Helper I
Helper I

Need help in DAX function

Hi,

I am evaluating the below DAX expression

Column 2 = contains(bi_salesFact,bi_salesFact[ProductID],"785",bi_salesFact[Revenue],68.1975)
 
I get a true where I have a combination as mentioned above.
But for table rows where the ProductID and Revenue values are different there also true is displayed.
Is this the expected behaviour.
 
Regards
1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @Mystery

 

The code you show will yield the same result in every row and it will be TRUE if the table contains that combination anywhere, in any of the rows. Check the syntax for CONTAINS

 

What do you need? A calculated column that tells you whether that row has the combination (ProductID, Revenue) you show? If so, you can use this for your column:

 

Column 2 = bi_salesFact[ProductID]="785" &&  bi_salesFact[Revenue]=68.1975

or this if you were to modify your code to make it work:

 

Column 2 = contains(CALCULATETABLE(bi_salesFact) ,bi_salesFact[ProductID],"785",bi_salesFact[Revenue],68.1975)

 

The first version is simpler and more efficient.The second is just for illustrative purposes, but not recommended.  

 

 

 

View solution in original post

2 REPLIES 2
AlB
Community Champion
Community Champion

Hi @Mystery

 

The code you show will yield the same result in every row and it will be TRUE if the table contains that combination anywhere, in any of the rows. Check the syntax for CONTAINS

 

What do you need? A calculated column that tells you whether that row has the combination (ProductID, Revenue) you show? If so, you can use this for your column:

 

Column 2 = bi_salesFact[ProductID]="785" &&  bi_salesFact[Revenue]=68.1975

or this if you were to modify your code to make it work:

 

Column 2 = contains(CALCULATETABLE(bi_salesFact) ,bi_salesFact[ProductID],"785",bi_salesFact[Revenue],68.1975)

 

The first version is simpler and more efficient.The second is just for illustrative purposes, but not recommended.  

 

 

 

Thanks let me check that out.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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