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
DataAnalysis
Frequent Visitor

Problems with duplicate data processing after a separate column

Hello.
I use PowerBI in Korea.
Recently, I've been doing a lot of different things since I started using PowerBI.
There is a recent issue, and I am writing here to ask for your advice.

There is data separated by , (Comma), and I used the Split Column function to visualize each of them.
Since using Split Column, duplicate data has been generated for working hours, causing problems with overall statistics. (See Excel below)
I want one of the two things.

 

Please refer to Case1 and Case2 in the figure.

1. Enter Working hour data divided by the number of columns after Split Column.

2. After Split Column, let Working Hour Data enter only the top one. Other than that, enter 0 or Null.

Any of the two cases is fine.

I need your advice.

PowerBI 중복 Data 없애는 법 질문 사진.JPG

 

※ I am sorry that I have to upload Excel example instead of PowerBI file due to internal data of the company.

1 ACCEPTED SOLUTION
ribisht17
Super User
Super User

Please make use of Column Tool to create this formula instead

 

Custom Case2 = IF( ( RANKX (
FILTER (
'community_assist_duplicate (2)',
'community_assist_duplicate (2)'[Working Number]
= EARLIER ( 'community_assist_duplicate (2)'[Working Number] )
),
'community_assist_duplicate (2)'[Working PLace],
,
ASC,
DENSE
)) =1,'community_assist_duplicate (2)'[Working Hours],"0")

 

 

ribisht17_0-1648700552838.png

 

Regards,

Ritesh 

"Please mark the answer if it helps you so that it can help others as well"

View solution in original post

10 REPLIES 10
ribisht17
Super User
Super User

You can download the PBIX from here PowerBI Community - Google Drive

Thank you very much.
I answered Solved first, but can I ask you an additional question?
Thanks to your dedication, heat is generated without errors. When I enter your Formula in New Column in Column Tool, Column is created!!

However, one other error occurs.

 

"DAX comparison operations do not support comparing values of type Integer with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values."
Case number is the Text type.

In the case of Active Hours, it is the Whole Number Type.

For MPC, the text type is not Number.
Since there are more than 10 locations, hexadecimal numbers A to F were also used to distinguish. Therefore, conversion to Whole Number is not possible...
If there is a problem, will it happen here?

Therefore, the following error occurs. What should I do?

 

When I converted the Actual hours to Text, all duplicate values were printed as they were.

PowerBI 중복 Data 없애는 법 질문 사진5.JPGPowerBI 중복 Data 없애는 법 질문 사진6.JPGPowerBI 중복 Data 없애는 법 질문 사진7.JPG

I tried this and that in my own way, but suddenly I got a good output value.

Thank you so much!
It's thanks to you. I was really surprised by your technical skills.

Glad that it helped you, Cheers 🙂

ribisht17
Super User
Super User

Please make use of Column Tool to create this formula instead

 

Custom Case2 = IF( ( RANKX (
FILTER (
'community_assist_duplicate (2)',
'community_assist_duplicate (2)'[Working Number]
= EARLIER ( 'community_assist_duplicate (2)'[Working Number] )
),
'community_assist_duplicate (2)'[Working PLace],
,
ASC,
DENSE
)) =1,'community_assist_duplicate (2)'[Working Hours],"0")

 

 

ribisht17_0-1648700552838.png

 

Regards,

Ritesh 

"Please mark the answer if it helps you so that it can help others as well"

ribisht17
Super User
Super User

Please find my refined DAX

Final Solution 2 = IF( ( RANKX (
FILTER (
'community_assist_duplicate (2)',
'community_assist_duplicate (2)'[Working Number]
= EARLIER ( 'community_assist_duplicate (2)'[Working Number] )
),
'community_assist_duplicate (2)'[Working PLace],
,
ASC,
DENSE
)) =1,'community_assist_duplicate (2)'[Working Hours],0)
ribisht17
Super User
Super User

Hi There,

 

Are you expecting something like this?

Final Nested Rank = IF( RANKX( ALL('community_assist_duplicate (2)'[Working PLace]),'community_assist_duplicate (2)'[Working PLace],,ASC)=1,'community_assist_duplicate (2)'[Working Hours],0)

ribisht17_2-1648617062436.png

 

Regards,

Ritesh

"Please mark the answer if it helps you so that it can help others as well"

Thank you very much for your dedicated advice.
As you advised, DAX modified the syntax to match my Data Column name.

(Working Number  = CaseNumber

Working Place = MPC

Wroking Hours = ActualHours)

 

However, grammatical errors continue to occur.
I will also show you my Data column.

Error Name : 

A single value for column 'actualhours' in table 'community_assist_duplicate (2)' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.

PowerBI 중복 Data 없애는 법 질문 사진3.JPGPowerBI 중복 Data 없애는 법 질문 사진4.JPG

My PowerBI level is a beginner, so I'm very ashamed.
I'd appreciate it if you could help me a little more.

Hey nothing to be ashamed, I am happy to help if I can, this time I think my mistake, please put the 0 within the quotation then you should not get the error, see the bold-one below

 

 

SUGGESTION 1: You should make use of your table name where you are in, community_assist_duplicate is my table name

 

SUGGESTION 2: Keep 0 within quotations

FILTER (
'community_assist_duplicate (2)',
'community_assist_duplicate (2)'[Working Number]
EARLIER ( 'community_assist_duplicate (2)'[Working Number] )
),
'community_assist_duplicate (2)'[Working PLace],
,
ASC,
DENSE
)) =1,'community_assist_duplicate (2)'[Working Hours],"0")

PowerBI 중복 Data 없애는 법 질문 사진2.JPG

Thank you for your advice.
That's right. Case 2 that I want.
I'm still a beginner, so I don't know much about the PowerQuery syntax.
I'm sorry.

As your advice, CustomColumn has executed your syntax on the data inside my company.
However, a token literal expected error occurs.

What is the problem with the syntax I created?

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.