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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.