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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
southpawmurph
New Member

Power Query Editor Conditional Column Output Format

Hello I am attempting to create a conditional column that takes a column's cell value in column "Ind_Exp" and translates the value (1,2,3,4,5,6) to "<=10" , "11-15", .etc. (outputs seen below). I am having issues with the Output value which is a string value shown as "11-15". Upon clicking "OK" in the Add Conditional Column window seen below it will format the "11-15" to a date of "11/15/2021". I want to keep the value as "11-15" and not a date, what ways can I resolve this formatting issue? 

2021-02-12 12_29_19-Data Analytics Project - Power Query Editor.png

 

1 ACCEPTED SOLUTION
edhans
Community Champion
Community Champion

Look at your code in the advanced editor. WHen you typed in 11-15, it did something like this:

if [Dept] = "DAIRY" then #date(2021,11,15) else null

Manually in the Advanced Editor (Home ribbon) change it to something like this:

if [Dept] = "DAIRY" then "11-15" else null

Then be sure the field is set to Text - Upper left icon that is ABC/123, make sure it says ABC.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

2 REPLIES 2
edhans
Community Champion
Community Champion

Look at your code in the advanced editor. WHen you typed in 11-15, it did something like this:

if [Dept] = "DAIRY" then #date(2021,11,15) else null

Manually in the Advanced Editor (Home ribbon) change it to something like this:

if [Dept] = "DAIRY" then "11-15" else null

Then be sure the field is set to Text - Upper left icon that is ABC/123, make sure it says ABC.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Hi,

this solution seems to break and revert to 'subtracting text' and converting to #date if you open the conditional column back up and saving.  Unless i am not following steps noted in solution above correctly.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.