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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

current date year and compare same date previous year divide

 is there any  option to compare current date year and same date year  previous year 

 

I have current date  September 15,2021  . i want to compare same as previous year septemer 01,2021 exactly one year beofer 

 

 

Data :

Period                         Revised closing value

01 sep 2020                              45

....                                              .....

...                                              .....

15 sep 2021                            56

 

i have created measure but i am getting blank value .

 

%Prvs = VAR LastMAXDate = MAX ( Data[Period] )
var currentvalue = CALCULATE (
SUM ( Data[Revised closing value] ),
Data[Period] = LastMAXDate
)
var prvsyear =
CALCULATE (
SUM ( Data[Revised closing value] ),
Data[Period] = LastMAXDate-365
)
return DIVIDE((currentvalue-prvsyear),prvsyear)
 
 
i am looking for  support.   Thanks in advance

 

 

1 REPLY 1
BeaBF
Super User
Super User

@Anonymous Try this:

 

%Prvs =
var maxxx = CALCULATE(MAX(Data[Period]), ALLSELECTED(Data[Period]))
var actual = CALCULATE(SUM(Data[Revised closing value]), Data[Period] = maxxx)
var prevmm = CALCULATE(SUM(Data[Revised closing value]), DATEADD(Data[Period], -1, YEAR))
var num = actual - prevmm

RETURN (num / prevmm)
 
Also, when creating this measure, be sure to select "decimal value" and choose 3 decimal places. Box in red:
pbi_comm_3.png
 
B.

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.