Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.