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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Druchii
Regular Visitor

Unexpected Expression in various Calculated columns

Hello, im currently working on automatization of debt analysis, and currently im having some issues with some dax calculated columns, all of which appear to work correctly, although a red bar appears in my code editor, and when i put my mouse over the last parenthesis, suddenly it appears a "Unexpected Expression" Message, which messes up my data view tab. Im wondering if having accent marks over my data or columns is the issue here.
The Calculated columns that have this type of issue are:

 

Antiguedad Meses = 
DATEDIFF ( 'Maestro Zuora'[Fecha Emision], EOMONTH ( TODAY(), -1 ), MONTH )
Compañía = 
IF (
    LEFT('Maestro Zuora'[WBE],4) = "CL25",
    "CL25",
    IF(LEFT('Maestro Zuora'[WBE],4) = "CL13","CL13",
    IF('Maestro Zuora'[Cuenta: Legal Entity] = "EnelX","CL25",IF('Maestro Zuora'[Cuenta: Legal Entity] = "EnelDistribucion","CL13","CL36"))
))
Antiguedad Maxima = 
IF (
    'Maestro Zuora'[Número de Factura Asociada]  = BLANK (),
    'Maestro Zuora'[Antiguedad Meses],
    CALCULATE (
        MAX ( 'Maestro Zuora'[Antiguedad Meses] ),
        ALLEXCEPT (
            'Maestro Zuora',
            'Maestro Zuora'[Número de Factura Asociada]
        )
    )
)
Negocio = 
SWITCH(TRUE(),
LEFT('Maestro Zuora'[WBE],8)="CL25E400", "eCity",
LEFT('Maestro Zuora'[WBE],8)="CL25E500", "eHome",
LEFT('Maestro Zuora'[WBE],8)="CL25E600", "eIndustry",
LEFT('Maestro Zuora'[WBE],8)="CL25E700", "eMobility",
LEFT('Maestro Zuora'[WBE],8)="CL13E400", "eCity",
LEFT('Maestro Zuora'[WBE],8)="CL13E500", "eHome",
LEFT('Maestro Zuora'[WBE],8)="CL13E600", "eIndustry",
LEFT('Maestro Zuora'[WBE],8)="CL13E700", "eMobility",
"NA"
)

 

 

This is the data model i'm working on:

Druchii_0-1660167334115.png

And Also the error message:UE1.png

And finally here's how this messes up my dataview tab

2 REPLIES 2
mktganalyst5050
Frequent Visitor

I am having a similar problem with the red bar. Have you been able to find out what it means? The best explanation I have been able to piece together is that the editor is expecting the first parameter to be tabular and is receiving something that is scalar or vice versa, but this is just a guess. I have not been able to find a true answer anywhere.

Anonymous
Not applicable

Hi @Druchii ,

 

Please share some sample data so that we could test the formula.

 

Best Regards,

Jay

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors