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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
andre1981
New Member

Compare value by highest selected month

Hi

I need to compare the monthly value with the value of the highest month selected, I'm using the measurements:

 

MaiorMesSelecionado = CALCULATE( MAX(VENDAS[MES]), ALLSELECTED(VENDAS) )
ValorMaiorMesSelecionado = CALCULATE(SUM(VENDAS[VALOR]),FILTER(VENDAS,VENDAS[MES] = [MaiorMesSelecionado]))

 

If I set the month 11, everything works

ValorMaiorMesSelecionado = CALCULATE(SUM(VENDAS[VALOR]), FILTER(VENDAS,VENDAS[MES] = 11))

, but when I use the measure of the biggest month, nothing works

 

this is my report

report.PNG

DATADATA

Need help

1 ACCEPTED SOLUTION
andre1981
New Member

I found the error

 

Previous measure (wrong): MaiorMes = CALCULATE(MAX(producao[MESREFERENCIA]);ALLSELECTED(producao[MESREFERENCIA]))
Correct Measure: MaiorMes = CALCULATE(MAX(producao[MESREFERENCIA]);ALLSELECTED(producao))

 

in the function ALLSELECTED, I added the table field, and I should have just added the table

View solution in original post

1 REPLY 1
andre1981
New Member

I found the error

 

Previous measure (wrong): MaiorMes = CALCULATE(MAX(producao[MESREFERENCIA]);ALLSELECTED(producao[MESREFERENCIA]))
Correct Measure: MaiorMes = CALCULATE(MAX(producao[MESREFERENCIA]);ALLSELECTED(producao))

 

in the function ALLSELECTED, I added the table field, and I should have just added the table

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.