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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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

July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.


Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors