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
Anonymous
Not applicable

Dax Calculation to remove similar records.

Below DAX gives some output. and i want to eliminate those records where i am getting same data for all the records.

 

Data is same for all the records here.Data is same for all the records here.

 

DAX : 

 

List of Part Details values =
VAR __DISTINCT_VALUES_COUNT = DISTINCTCOUNT('configuration_analysis'[Part Details])
VAR __MAX_VALUES_TO_SHOW = 6
RETURN
IF(
__DISTINCT_VALUES_COUNT > __MAX_VALUES_TO_SHOW,
CONCATENATE(
CONCATENATEX(
TOPN(
__MAX_VALUES_TO_SHOW,
VALUES('configuration_analysis'[Part Details]),
'configuration_analysis'[Part Details],
ASC
),
'configuration_analysis'[Part Details],
", ",
'configuration_analysis'[Part Details],
ASC
),
", etc."
),
CONCATENATEX(
VALUES('configuration_analysis'[Part Details]),
'configuration_analysis'[Part Details],
", ",
'configuration_analysis'[Part Details],
ASC
)
)

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @Anonymous

Is the DAX "List of Part Details values" a column or a measure?

I can't find it in the matrix, could you tell me where does this formula add?

Which cells do you need to eliminate? Is the bright yellow line?

 

Additionally, you could consider SUMMARIZE function to remove the duplicated rows/values.

Similar thread

https://community.powerbi.com/t5/Desktop/Power-BI-DAX-query-to-remove-duplicated-rows-values-in-SUM/td-p/465004

 

Could you share me some data as example so i can analyze in your scenario?

 

Best Regards

Maggie

Anonymous
Not applicable

Hi,

 

This might help you https://www.c-sharpcorner.com/article/variable-in-dax-keep-rows-and-remove-rows-in-power-bi/

 

OR 

 

Create a Custom column. Use SWITCH function to find rows where all columns contain the same variable:

 

Column = SWITCH(TRUE(),
column_name = column_name1, "1", 

column_name1 = column_name2, "1",

column_name3 = column_name4, "1", 

"0"

 

And then simply filter out the calculated column by selecting only those values with the value "0".

 

Hope it helps.

 

Anonymous
Not applicable

Sorry i forget to mention. above table (image) is matrix and from 3 column onwards all are values of attribute DCA (attribute_name).

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.