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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
anony711
Frequent Visitor

New added column in file - not in previous dataset

Hello everyone,

 

Thank you for reading my query. 

 

I have a folder which contains many excel files which are downloaded on a monthly basis. 

 

From Oct 2021 till Nov 2022 there are fields called "WC and EC" amongst others.

These two categories are merged to make a category called WC1. 

 

In Dec 2022, "EC" exists, "WC" also exists but data has been migrated to a new field called "UPT".

 

With further migration taking place, eventually "WC" will not exist and will be replaced by "UPT".

 

My question is:

My dashboard works fine but for Dec 2022 data is wrong due to UPT being added. 

 

What can I do to reflect the correct figures?

Thank you 

 

 

1 ACCEPTED SOLUTION

 

Almost. It would be:

if [Date] >= #date(2022, 12, 01) then [UPT] else [WC]

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

6 REPLIES 6
anony711
Frequent Visitor

Thank you @BA_Pete - appreciate your kind assistance 🙂

BA_Pete
Super User
Super User

Hi @anony711 ,

 

Update the code that creates your [WC1] column to something like this:

Text.Combine(
    {
        [EC],
        if [WC] <> null then [WC] else [UPT]
    }
)

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Thank you @BA_Pete for your reply. 

Unfortunately I cannot use your formula as it fills all the WC, which are blank. WC is blank for some datasets because data was still migrating and thats fine.

 

UPT only is for Dec 2022.

 

How can I do it only for Dec 2022 and integrate in the dashboard leaving rest of the data sets as it is?

 

You would use something like this to only change values for Dec 22:

if Date.Month([Date]) = 12 and Date.Year([Date]) = 2022 then [UPT] else [WC]

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Thank you @BA_Pete , so I guess if you want it for month and year after Dec 2022 (included) e.g. Dec 2022, Jan 2023, Feb 2023 etc then it would be:

 

Date.Month >= 01/12/2022 then [UPT] else [WC]?

 

 

 

Almost. It would be:

if [Date] >= #date(2022, 12, 01) then [UPT] else [WC]

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors