Percent value based on previous on the month of the previous year

I would like to make a comparison between a % of the month of the previous year and the % of the current month. How can i get this?

This is the formula that i actually use to get the % of the previous year

(SUM(
SELECT(Bilancio[Netto mensile],YEAR([DATA])=YEAR("01/01/2021")
))
/(SUM(
SELECT(Bilancio[Totale entrate],YEAR([DATA])=YEAR("01/01/2021")
)))

tks

Solved Solved
0 3 67
1 ACCEPTED SOLUTION

You can change this part of your expression for the % of the year:

=YEAR("01/01/2021")

For this

=YEAR([_THISROW].[DATA])-1

That would automatically get the % for the previous year for the row that it is being calculated on

View solution in original post

3 REPLIES 3

Hello @DaGi07 you can use this expression, but if you could share more information about your tables I could make it more efficient.

(
SUM(SELECT(Bilancio[Netto mensile],MONTH([DATA])=MONTH(TODAY())))
/
SUM(SELECT(Bilancio[Totale entrate],MONTH([DATA])=MONTH(TODAY())))
)
/
( your % expression for getting the % of the previous year )

it works partially because i have more than one year (2020,2021) and in this way consider all the years. I would consider only the previous year (2021) 

Schermata 2022-05-12 alle 15.27.39.png

โ€ƒ@Rafael_ANEIC-PY attach the screen of table Bilancio

TKS

You can change this part of your expression for the % of the year:

=YEAR("01/01/2021")

For this

=YEAR([_THISROW].[DATA])-1

That would automatically get the % for the previous year for the row that it is being calculated on

Top Labels in this Space