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
Luis_Caston
Helper III
Helper III

The True/False expression does not specify a column.

Dear all,

I've a problem with this formula and I don´t know why.

Formula:

FORMAT(CALCULATE([Peso Neto Salidas], ALL(Cliente[Alias Cliente]), ALL(LineasSalidas[Alias - Marca]), MAX(Calendario[AñoFiscal])-1), "#,0,") & " " & "kg total"

When I add this: MAX(Calendario[AñoFiscal])-1 I obtain header error.

I've a column Fiscal Year (as number) and I want to rest -1 to the Fiscal Year selected.

Do you know what I'm doing wrong?
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Luis_Caston ,

 

Thanks elitesmitpatel for the quick reply. I have some other thoughts to add:

Peso Neto Salidas Año Fiscal -1 = 
var _a= CALCULATE([Peso Neto Salidas], FILTER(ALL('Calendario'),[AñoFiscal]=SELECTEDVALUE('Calendario'[AñoFiscal])-1)) 
 RETURN FORMAT(_a,"#,0,") & " kg total"

vtangjiemsft_0-1727076524908.pngvtangjiemsft_1-1727076544964.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @Luis_Caston ,

 

Thanks elitesmitpatel for the quick reply. I have some other thoughts to add:

Peso Neto Salidas Año Fiscal -1 = 
var _a= CALCULATE([Peso Neto Salidas], FILTER(ALL('Calendario'),[AñoFiscal]=SELECTEDVALUE('Calendario'[AñoFiscal])-1)) 
 RETURN FORMAT(_a,"#,0,") & " kg total"

vtangjiemsft_0-1727076524908.pngvtangjiemsft_1-1727076544964.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Wow @Anonymous that's what I needed!!

Thank you so much!!
That's perfect.

@elitesmitpatelthank you so much too, appreciate!

Luis_Caston
Helper III
Helper III

Dear all!

I add the pbix: Year -1 

 

Thank you for your support.

elitesmitpatel
Super User
Super User

Please share the PBIX file with Dummy data and Highlight the expected output.

elitesmitpatel
Super User
Super User

Hey @Luis_Caston 

The issue with your formula is related to how MAX(Calendario[AñoFiscal])-1 is used inside the FORMAT function. The error occurs because MAX(Calendario[AñoFiscal])-1 may not be handled correctly when passed into functions like FORMAT without proper context.

Try this Measure:--

VAR PreviousFiscalYear = MAX(Calendario[AñoFiscal]) - 1

RETURN
FORMAT(
CALCULATE(
[Peso Neto Salidas],
ALL(Cliente[Alias Cliente]),
ALL(LineasSalidas[Alias - Marca]),
PreviousFiscalYear
),
"#,0,"
) & " kg total"

If it helps Kudos the work and Accept it as Solution.

Hi @elitesmitpatel 

Thank you for your support!
Same error. I've change your approach avoiding the FORMAT but idem, the same error:

VAR PreviousFiscalYear = MAX(Calendario[AñoFiscal]) - 1

RETURN

CALCULATE(
[Peso Neto Salidas],
ALL(Cliente[Alias Cliente]),
ALL(LineasSalidas[Alias - Marca]),
PreviousFiscalYear
)

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.