Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
 
					
				
		
Dears,
I need your support to help me transform the formula below to PQ format:
IF(AND([col1]<=50,[col1]>=0),"28.3",IF(AND([col1]>=51,[col1]<=75),"33.55",IF(AND([col1]<=100,[col1]>=76),"38.8",IF(AND([col1]>=101,[col1]<=200),"61.6",IF(AND([col1]>=201,[col1]<=400),"85.6",IF(AND([col1]>=401,[col1]<=500),"95.2",IF(AND([col1]>=501,[col1]<=700),"115.6",IF(AND([col1]>=701,[col1]<=900),"184.9","234.4"))))))))
Thanks
Solved! Go to Solution.
 
					
				
		
Hi @Anonymous ,
You can add conditional columns.
Or add a custom column.
if [col1] <= 50 and [col1] >= 0 then "28.3" else if [col1]>= 51 and [col1] <= 75 then "33.55" else if [col1] <= 100 and [col1] >= 76 then  "38.8" else if [col1] >= 101 and [col1] <= 200 then "61.6" else if [col1] >= 201 and [col1] <= 400 then "85.6" else if [col1] >= 401 and [col1] <= 500 then "95.2" else if [col1] >= 501 and [col1] <= 700 then "115.6" else if [col1] >= 701 and [col1] <= 900 then "184.9" else "234.4" 
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
 
					
				
		
Hi @Anonymous ,
You can add conditional columns.
Or add a custom column.
if [col1] <= 50 and [col1] >= 0 then "28.3" else if [col1]>= 51 and [col1] <= 75 then "33.55" else if [col1] <= 100 and [col1] >= 76 then  "38.8" else if [col1] >= 101 and [col1] <= 200 then "61.6" else if [col1] >= 201 and [col1] <= 400 then "85.6" else if [col1] >= 401 and [col1] <= 500 then "95.2" else if [col1] >= 501 and [col1] <= 700 then "115.6" else if [col1] >= 701 and [col1] <= 900 then "184.9" else "234.4" 
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
the syntax has the following pattern:
if [col1] <= 50 and [col1] >= 0 then "28.3" else if ....
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data  -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
 
					
				
				
			
		
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
