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
PortoIvan
New Member

Compare, evaluate, and visualize “mismatched” data across a table

Hello! 

I have been trying for weeks to figure out the best way to determine then visualize the occurrence of what I call mismatched data within a table. 

consider my sample data below in the following layout:

 

Date

Member 

Vendor

SKU 

Category 

9/22/22

  A

Homemade 

11-110

Price Match

9/20/22

  A

Homemade 

11-110

No Price Found 

9/12/22

  B

Wooden 

23-1111

Price Match

8/20/22

  C

Homemade 

000-245

Price Match

8/15/22

  B

Wooden 

23-1111

No Price Found 

7/10/22

  B

Wooden 

23-1111

No Price Found 

7/02/22

  A

Homemade 

11-110

Price Match

7/01/22

  C

Homemade 

000-245

Price Match

 

I am trying to create a measure or configure the table above so that for each Member, Vendor, and SKU, the resulting category is compared to previous categories of the same Member, Vendor, and SKU. 

For example, Member A purchased item 11-110 from the same vendor on 3 different occasions. 2 of those occasions resulted in a category of Price Match but 1 of those purchases resulted in a category of No Price Found. I would like the purchase that resulted in the "mismatch" to be displayed in the table or visual.

 

Doing this will help me track, prioritize work, and highlight category mismatches that occur. 

I appreciate any help!

1 ACCEPTED SOLUTION

@PortoIvan Did you mean that for B that the mismatch is "Price Found"? If that is the case, then you could do this:

Complex Selector = 
    VAR __Member = MAX('Table'[Member ])
    VAR __Category = MAX('Table'[Category ])
    VAR __Table = SUMMARIZE(FILTER(ALL('Table'),[Member ] = __Member),[Category ],"__Count",COUNTROWS('Table'))
    VAR __Min = MINX(__Table,[__Count])
    VAR __MinCategory = MINX(FILTER(__Table, [__Count] = __Min),[Category ])
RETURN
    IF(__Category = __MinCategory,1,0)

Greg_Deckler_0-1666308998438.png

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

6 REPLIES 6
PortoIvan
New Member

You're amazing! Thank you! This solved my problem!! 

Greg_Deckler
Super User
Super User

@PortoIvan Couldn't you just use the Filters pane to remove any "Price Match" for Category?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler  Unfortunately no, because although that would work for one member for another member  a category of "Price Match" might not be the "mismatch". For example using the same table I provided Member B ordered Item 23-111 multiple times, however in their case the mismatch is the 1 purchase they made where the item had a category of Price Match, since No Price Found occurred twice where as Price Match occurred once.  

@PortoIvan Did you mean that for B that the mismatch is "Price Found"? If that is the case, then you could do this:

Complex Selector = 
    VAR __Member = MAX('Table'[Member ])
    VAR __Category = MAX('Table'[Category ])
    VAR __Table = SUMMARIZE(FILTER(ALL('Table'),[Member ] = __Member),[Category ],"__Count",COUNTROWS('Table'))
    VAR __Min = MINX(__Table,[__Count])
    VAR __MinCategory = MINX(FILTER(__Table, [__Count] = __Min),[Category ])
RETURN
    IF(__Category = __MinCategory,1,0)

Greg_Deckler_0-1666308998438.png

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckleryour correct I meant the mismatched occurred where the category for one of the three purchases made by member B was "Price Match" I edited my previous reply. 

@PortoIvan I edited my reply also with what I believe is the solution.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.

Top Solution Authors