cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted

Conditional Column when creating a new column

Hi,

So i have a new column that is not inside in my actual table so i want to do a conditional column but couldn't find my "new column" that i just created. 


here's my new column:
23.JPG

but when i click the "Edit Queries" i cant see my "no of yrs" column that i just created .
Need help please, sorry not really sure about Power BI yet. Thank u

8 REPLIES 8
stvsurf Regular Visitor
Regular Visitor

Re: Conditional Column when creating a new column

Depending on the way your column should work or which calculation you want to perform, you can create them in:

1/ in Power BI (with DAX), what I believe you did

2/in Power Query (with M), you end up in Power Query if you click "Edit Queries" in Power BI

 

All columns you create in power query end up in Power BI (assuming you enable load), but the extra columns you create in Power BI don't end up in Power query because it's the layer below.

Re: Conditional Column when creating a new column

Thank you for the reply, yeah so my worries is since i can't find the "no of yrs" in my power query as i want to do a conditional column. What can i do then?

here's my table inside the power query that doesn't include my new added "no of yrs" . Not really sure on how to do this inside the power query as because in power bi desktop i cant see the conditional column
24.JPG

stvsurf Regular Visitor
Regular Visitor

Re: Conditional Column when creating a new column

@Ellensantiago1  Can you create the column in Power BI again, and just before you finish creating it take a screen shot of the formula.

Re: Conditional Column when creating a new column

Here's the column that i created, (it's inside the BI desktop not in BI Query)
25.JPG

stvsurf Regular Visitor
Regular Visitor

Re: Conditional Column when creating a new column

Assuming you have the column [no of mths] in Power Query available, you can try this formula

 

if Number.RoundUp([no of mths]/12,0) > 10 then " >Yr 10" else Text.Combine({"Yr ",Number.ToText(Number.RoundUp([no of mths]/12,0))})

Re: Conditional Column when creating a new column

Hi both no of months and no of yrs are new columns that i created in power bi desktop hence when i check inside the power query i can't find either one of them. 😞

stvsurf Regular Visitor
Regular Visitor

Re: Conditional Column when creating a new column

No worries, can you explain what you want to achieve with this conditional column and which condition you want to put in it.

I was trying to address the question on why it wasn't in Power Query and tried to help you to get that, but with some extra information, it could be that you don't even need it in power query.

 

Community Support Team
Community Support Team

Re: Conditional Column when creating a new column

Hi @Ellensantiago1 

The calculated columns and measures created in Power BI Desktop doesn't show on the Power Query data table, it is by default.

Could you show detailed reuqirements of these columns so that i can create custom column in Power Query instead?

 

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

Helpful resources

Announcements
New Kudos Received Badges Coming

New Kudos Received Badges Coming

Kudos to you if you earned one of these! Check your inbox for a notification.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,423)