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

Duplicate to null and date to integer

Hey Guys,

 

I have the issue, that my data involves dates, some with duplicates, some without. Now what I need/want to do, is:

1.  instead of deleting the duplicates make them to null values.

2. tranform all the remaining date values into integer.

 

Thanks for the help, cheers!

 

Nick

3 REPLIES 3
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Nick2,

 

Have you solved your problem?

 

If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

If you still need help, please feel free to ask.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-piga-msft,

 

tahnks for the quick answer, I'm sorry it took me so long to reply. Sadly your answer doesn't quit fix the problem, which is my fault as I wasn't precise enough. My Data looks like this:

DateSpace
11.06.2018A
12.06.2018B
13.06.2018A
13.06.2018A+C
14.06.2018B
14.06.2018C
15.06.2018C
16.06.2018 
17.06.2018A
17.06.2018B
17.06.2018C

Now there are always three rooms available (A,B,C) but not always booked and I need to know how booked we actually are. My idea was to find this out, by replacing the date with a 3, the letter with a 1, take the sums and divide the values. This obviously means, that:

1. I need to remove the dates that are more often named then one (two or three times, I misused the word duplicate, sry!) but without deleting them as I need the information from the other column. Which is why I wanted to transform them into null values.

2. change the remaining date values to 3 (as in reallity those are way more, without addressing all of them single handly)

 

I hope this clarifys the issue, again I'm sorry if I wasn't precise enough and I hope you'll still be able to help out.

 

greetings, Nick

v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Nick2,

 

You could achieve this in Query Editor by the steps below.

 

1. Go to Query Editor and select the Date column and click Group By like below.

 

group by.PNG

 

2. Then select Date and Count, click Unpivot  Columns and you will get the values below;

 

unpivot.PNG

 

3. Replace the value 2 to null and remove other columns.

 

Untitled.png

 

 

4.Filer the values without 1.

 

filter.PNG

 

5. Change Date type to Whole number.

 

change type.png

 

For reference, you could have a look at my test file which has been attached below.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.