Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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",
    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],
        MAX ( 'Maestro Zuora'[Antiguedad Meses] ),
        ALLEXCEPT (
            'Maestro Zuora',
            'Maestro Zuora'[Número de Factura Asociada]
Negocio = 
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",



This is the data model i'm working on:


And Also the error message:UE1.png

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

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.

Community Support
Community Support

Hi @Druchii ,


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


Best Regards,


Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Helpful resources

PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors