cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Paulyeo11
Impactful Individual
Impactful Individual

How to recode 1 to 30 Days 2 to 60 Days from Payment term field ?

Hi All

I am doing append , so i cannot use PQ to recode , as DAX i can just paste the code.

Paulyeo11_0-1605943192618.png

 

 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Paulyeo11

When you make a transformation in PQ, the steps will be applied whenever you load or refresh data. You do not need to repeat this process. However, if you need to do it in DAX, then, you shoudl create a an additional conditional column as follows:

New Column = 
SWITCH(
    [Column with number],
    1 , "30 Days",
    2, "60 days"
)

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it useful

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube Linkedin




Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

4 REPLIES 4
Fowmy
Super User
Super User

@Paulyeo11

When you make a transformation in PQ, the steps will be applied whenever you load or refresh data. You do not need to repeat this process. However, if you need to do it in DAX, then, you shoudl create a an additional conditional column as follows:

New Column = 
SWITCH(
    [Column with number],
    1 , "30 Days",
    2, "60 days"
)

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it useful

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube Linkedin




Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Paulyeo11
Impactful Individual
Impactful Individual

Hi Sir

In that case i need to do at PQ. thank you for sharing.

Does it mean that if i add new column in PQ , and when i append 2 table , the column will stay ? As when i as column in DAX , after i append the column missing

Fowmy
Super User
Super User

@Paulyeo11 

 

Didn't get the question right but if you want to replace those numbers with your own text, you can do it in power query using Replace Value. Right-Click on the column, select Replace Value and enter "30 Days" for example for number 1. Repeat for the numbers as well.

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn


 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Paulyeo11
Impactful Individual
Impactful Individual

Hi Fowmy

I already know how to recode using PQ.

I need to learn how to recode using DAX.

Because now i try to learn append , and if i do in PQ , every time i need to manually do again and again, if i have DAX script , i can just copy and paste

Paul

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors