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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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
Resolver I
Resolver I

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.

Anonymous
Not applicable

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

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

Anonymous
Not applicable

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

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))})

Anonymous
Not applicable

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. 😞

Hi @Anonymous 

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.

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.

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors