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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
WanderingBI
Resolver III
Resolver III

Feature Request: Add conditional column WITH data type

Dear Team,

 

I think it would be helpful if it was possible to set the data type for a newly inserted conditional column directly in the wizzard that helps to set the conditions.

 

Currently, "Add Column" -> "Conditional Column" will create a line of M like this:

 

 

 

 

GateInEmpty = Table.AddColumn(Source, "GateIn Empty", each if [GATEIN_DATE] = null then true else false),

 

 

 

 

 

Then we can either

  1. add a new step to change the type of the column
  2. edit the M code in the formula bar or advanced editor to achieve a result like this:

 

 

 

 

GateInEmpty = Table.AddColumn(Source, "GateIn Empty", each if [GATEIN_DATE] = null then true else false, type logical),

 

 

 

 

 

In daily usage, I like to avoid the extra step, especially because i can't remember the m code for the types by heart, i always have to keep a short list in OneNote to look it up and copy & paste from there:

 

, Int64.Type

, type date

, type logical

 

So i think it would be nice to have a small dropdown menue in the conditional column wizzard to add the data type for the new column.

 

What do you think?

 

Best Wishes

2 REPLIES 2
amitchandak
Super User
Super User

@WanderingBI 

I can already see datatype option there https://docs.microsoft.com/en-us/powerquery-m/table-addcolumn

 

Table.AddColumn(table as table, newColumnName as text, columnGenerator as function, optional columnType as nullable type) as table

 

does that not serve purpose

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Dear  amitchandak,

 

Thank you for your reply.

I am aware that i can define the data type in the M query directly.

However I normally use the add conditional column feature from the Power BI GUI instead of writing the code by myself.

 

I would wish for this GUI window to have a data type selection option so that it can write the code accordingly for me automatically:

Ibanez2000_1-1662709528047.png

 

 

 

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.