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

Get list of rows that has different values for a specific column

Hi, 

 

I am not able to figure our this speciifc Dax problem and need communities help. 

 

Sample data below where we have data for products by City :

 

Jagan_MFilterIT_0-1657039569221.png

 

Basically row highlighted in red are cities where the price is different for a given day. The solution required is to return a matrix like below 

 

Jagan_MFilterIT_1-1657039703266.png

 

 

List of cities where prices differ between rows. Can you please guide me on the Dax for this? 

 

 

 

 

2 ACCEPTED SOLUTIONS
ryan_mayu
Super User
Super User

@Jagan_MFilterIT 

you can create a column

Column = 
var _price=maxx(FILTER('Table','Table'[date]=EARLIER('Table'[date])&&'Table'[productcode]=EARLIER('Table'[productcode])&&'Table'[City]=EARLIER('Table'[City])&&'Table'[City Price]<>EARLIER('Table'[City Price])),'Table'[City Price])
return if(ISBLANK(_price),"N","Y")

1.PNG

pls see the attachment below

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

v-cgao-msft
Community Support
Community Support

Hi @Jagan_MFilterIT ,

 

Please create a new measure and apply it to the filter for this vision and set it up as shown in the figure.

Measure = DISTINCTCOUNT('Table'[City Price])

vcgaomsft_0-1657245616689.png

The PBIX file is attached for reference.

 

Best Regards,
Gao

Community Support Team

 

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

View solution in original post

3 REPLIES 3
v-cgao-msft
Community Support
Community Support

Hi @Jagan_MFilterIT ,

 

Please create a new measure and apply it to the filter for this vision and set it up as shown in the figure.

Measure = DISTINCTCOUNT('Table'[City Price])

vcgaomsft_0-1657245616689.png

The PBIX file is attached for reference.

 

Best Regards,
Gao

Community Support Team

 

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

Thannks much! This logic simply didt strike me at all! 

ryan_mayu
Super User
Super User

@Jagan_MFilterIT 

you can create a column

Column = 
var _price=maxx(FILTER('Table','Table'[date]=EARLIER('Table'[date])&&'Table'[productcode]=EARLIER('Table'[productcode])&&'Table'[City]=EARLIER('Table'[City])&&'Table'[City Price]<>EARLIER('Table'[City Price])),'Table'[City Price])
return if(ISBLANK(_price),"N","Y")

1.PNG

pls see the attachment below

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.