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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Seek help on GL Mapping Code error msg

Hi All

Below is the script from another PBI file :-

Dax_Recode =
SWITCH(TRUE(),MAX('Table'[GL_CODE])<=9,"REVENUE",MAX('Table'[GL_CODE])<=19,"COGS",BLANK())
I paste to new measure , i get the error msg , may i know what does it mean ? How to correct ?

 

Paulyeo11_0-1602135049148.png

 

1 ACCEPTED SOLUTION

@Anonymous , You are creating a measure. You need a column in this case

 

 

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

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@Anonymous , You are creating a column. No need of MAX, Table name is wrong. Correct that

 

Dax_Recode =
SWITCH(TRUE(),('GL_CODE'[GL_CODE])<=9,"REVENUE",('GL_CODE'[GL_CODE])<=19,"COGS",BLANK())

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
Anonymous
Not applicable

Hi Amit

 

I have enter the correct Table name , when i paste your script , i have error .

Paulyeo11_0-1602135941240.png

 

Anonymous
Not applicable

@Anonymous  you can make use of this measure

Conditional column = if(Orders[Unit Price]<=7,"REVENUE",if(Orders[Unit Price]<=10,"PROFIT",BLANK()))
But replace  orders table name with your table name

@Anonymous , You are creating a measure. You need a column in this case

 

 

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
Anonymous
Not applicable

Hi Amit

Thank you , it work now.

Paulyeo11_0-1602137344717.png

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.