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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
THENNA_41
Post Partisan
Post Partisan

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
Impactful Individual
Impactful Individual

@THENNA_41 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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors