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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Sabeer93
Frequent Visitor

OR Logic With Matching count in Power BI Desktop using DAX

Hello Power BI Team, 

Logic: We have slicer to filter the Product column, When the users selects the Multiple Products from the slicer . Its should the show the matching count of the Transacation ID in the card visual. Please can someone help me with the DAX logic. 

@dax 

1 ACCEPTED SOLUTION
WinterMist
Impactful Individual
Impactful Individual

@Sabeer93 

 

Thanks for clarifying scenario #2.

Hopefully I am understanding correctly now.

 

Please create the following 2 measures:

WinterMist_0-1691010803175.png

 

WinterMist_1-1691010969730.png

 

WinterMist_2-1691011043279.png

 

Test Scenario 1 =

Brush & Eggs should return 0 because there are 0 matching Transaction ID's selected.

 

WinterMist_3-1691011291796.png

 

Test Scenario 2 =

Brush, Eggs & Beer should return 0 because there are 0 matching Transaction ID's selected.

 

WinterMist_4-1691011364224.png

 

Test Scenario 3 =

Brush, Tooth Paste & Pencil should return 3 because there are 3 matching ID's selected.

 

WinterMist_5-1691011470490.png

 

 

In summary, for the 3 scenarios discussed, the Card Visual is returning the desired result; unless I have completely misunderstood yet again.

 

Let me know if there are other scenarios for which the Card Visual does not return the desired result.

 

Hope this is helpful to you.

 

Regards,

Nathan

View solution in original post

15 REPLIES 15
Sabeer93
Frequent Visitor

@Take3 ,@daxhelp 
Please can you look into the attached file. I'm able to get the output using the Matrix visual but need to get the output in Card Visual 

Sabeer93
Frequent Visitor

Transacation ID you use the different for each Product. In my many products have the same transacations id 

Please provide a data sample, showing how multiple products are sharing the same Transaction ID.

Thanks for sharing!  Very helpful.

 

This is what you need.

 

Take3_0-1690581351110.png

 

Regards,

Nathan

No, you didnt get my requirement, The requirement is to show only matching count of display products with the same transaction id 

Whenever they select the 2 different records from the Product table its should check the matching count of transaction id and its should show the matching record count 

My apologies.  I still do not understand.

 

1) If the user selects Brush & Eggs, what should the correct result be?

Take3_0-1690583335081.png

 

2) If the user selects Brush, Eggs & Beer, what should the correct result be?

 

3) If the user selects Brush, Tooth Paste & Pencil, what should the correct result be?

 

I believe I will understand better once you answer these 3 scenarios for me.

 

Regards,

Nathan

) If the user selects Brush & Eggs, what should the correct result be? Zero 

 

 

2) If the user selects Brush, Eggs & Beer, what should the correct result be? Two 

 

3) If the user selects Brush, Tooth Paste & Pencil, what should the correct result be? Three 

 

I guess I was wrong.  Still struggling to understand...

 

1) Brush & Eggs = 0 because there are 0 matches between the 2 transaction IDs?

 

2) Brush, Eggs & Beer = 2 because ???

Each of these products has a different Transaction ID.

I would think that because there are no matches, this would be 0 also.

Can you help me understand how the result should be 2?  

 

3) Brush, Tooth Paste & Pencil all share the same Transaction ID.

So there are 3 products that share the same matching ID.

I think believe that's why the answer is 3.  Is that correct?

Yes.. you are correct. can you help me with the logic 

@Take3  @Daxhelp 

Any luck with the solution ?

@Sabeer93 

 

I am still confused by scenario #2.

IF Brush, Eggs & Beer are selected THEN you're saying the expected result is 2.

 

Take3_0-1690825061160.png

 

Take3_1-1690825180242.png

 

This doesn't make sense to me.  For this scenario there are zero matching Transaction IDs.  In this case, I would expect the result to be "zero".

Can you help me understand how you are calculating the result as "2"?

 

Regards,

Nathan

Hello Nathan, @Take3  

Sorry for the confusion. the answer is zero not two. can you help me with the logic 

WinterMist
Impactful Individual
Impactful Individual

@Sabeer93 

 

Thanks for clarifying scenario #2.

Hopefully I am understanding correctly now.

 

Please create the following 2 measures:

WinterMist_0-1691010803175.png

 

WinterMist_1-1691010969730.png

 

WinterMist_2-1691011043279.png

 

Test Scenario 1 =

Brush & Eggs should return 0 because there are 0 matching Transaction ID's selected.

 

WinterMist_3-1691011291796.png

 

Test Scenario 2 =

Brush, Eggs & Beer should return 0 because there are 0 matching Transaction ID's selected.

 

WinterMist_4-1691011364224.png

 

Test Scenario 3 =

Brush, Tooth Paste & Pencil should return 3 because there are 3 matching ID's selected.

 

WinterMist_5-1691011470490.png

 

 

In summary, for the 3 scenarios discussed, the Card Visual is returning the desired result; unless I have completely misunderstood yet again.

 

Let me know if there are other scenarios for which the Card Visual does not return the desired result.

 

Hope this is helpful to you.

 

Regards,

Nathan

Take3
Regular Visitor

@Sabeer93 

 

Please try the following.

 

Take3_0-1690576205706.png

 

Take3_1-1690576241842.png

 

Take3_2-1690576282179.png

 

Hope this is helpful to you.

Nathan

 

 

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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