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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
margheritamart
Frequent Visitor

Table.AddColumn argument not working

Hi!

 

I am trying to create wordcount bands in Power Query editor but I am doing something wrong as I get only <500 or 500 to 2000, i get why but I have not been able to create the different band properly

= Table.AddColumn(#"Changed Type", "Wordcount bands3", each if [#"Project size#(lf)(total)"] < 500 then "< 500" else if [#"Project size#(lf)(total)"] > 500 then "500 to 2000" else if [#"Project size#(lf)(total)"] > 2000 then "2000 to 5000" else if [#"Project size#(lf)(total)"] > 5000 then "5000 to 10000" else if [#"Project size#(lf)(total)"] > 10000 then ">10000" else null)

Can someone help me please?

TGhanks

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @margheritamart ,

Please modify the formula to:

= Table.AddColumn(#"Changed Type", "Wordcount bands3", each if [#"Project size#(lf)(total)"] < 500 then "< 500" else if [#"Project size#(lf)(total)"] > 500 and [#"Project size#(lf)(total)"]<=2000 then "500 to 2000" else if [#"Project size#(lf)(total)"] > 2000 and [#"Project size#(lf)(total)"]<=5000 then "2000 to 5000" else if [#"Project size#(lf)(total)"] > 5000 and [#"Project size#(lf)(total)"]<=10000 then "5000 to 10000" else if [#"Project size#(lf)(total)"] > 10000 then ">10000" else null)

By my test it works fine:

vyanjiangmsft_0-1689230988969.png

I attach my sample below for your reference.

 

Best regards,

Community Support Team_yanjiang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yanjiang-msft
Community Support
Community Support

Hi @margheritamart ,

Please modify the formula to:

= Table.AddColumn(#"Changed Type", "Wordcount bands3", each if [#"Project size#(lf)(total)"] < 500 then "< 500" else if [#"Project size#(lf)(total)"] > 500 and [#"Project size#(lf)(total)"]<=2000 then "500 to 2000" else if [#"Project size#(lf)(total)"] > 2000 and [#"Project size#(lf)(total)"]<=5000 then "2000 to 5000" else if [#"Project size#(lf)(total)"] > 5000 and [#"Project size#(lf)(total)"]<=10000 then "5000 to 10000" else if [#"Project size#(lf)(total)"] > 10000 then ">10000" else null)

By my test it works fine:

vyanjiangmsft_0-1689230988969.png

I attach my sample below for your reference.

 

Best regards,

Community Support Team_yanjiang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you! It works perfectly!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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