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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors