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
Anonymous
Not applicable

Problems in measure previous period revenue

Good Morning,
 
I have two problems with this measure of income from the previous period, belo
 
% CRESCIMENTO Receitas = 

VAR
ReceitasLY = CALCULATE([RECEITAS];SAMEPERIODLASTYEAR('dCalendário'[Data Base]))
return
if([RECEITAS]=BLANK();BLANK();DIVIDE([RECEITAS]-ReceitasLY;ReceitasLY))

 

1 - The measure is not returning the correct percentage. My current period is Jan to Dec / 2017 and you are not calculating from Jan to Dec / 2016. He's adding up the two years on the table. Totally wrong.

 

medida 1.jpg

 

2 - When I select any filter in the same table the measure informs that there is no continuous table of dates. I have the calendar table related to fact table.

 

 

medida 2.jpg

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for your suggestions, they are correct, but I need the card to return the calculation from Jan to Oct / 16 from Jan to Oct / 17. In the case would be the percentage of 13.37% (difference until October of each year)

 

medida YTD.jpg 

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

Generally the way that I have seen this done is with measures like this:

 

YTD Revenue = TOTALYTD(SUM(Sales[Revenue]),'Date'[Date])

LY YTD Revenue = CALCULATE([YTD Revenue],SAMEPERIODLASTYEAR('Date'[Date]))

YTD Sales Var = [YTD Revenue]-[LY YTD Revenue]

YTD Sales Var % = DIVIDE([YTD Sales Var],[LY YTD Revenue])

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks for your suggestions, they are correct, but I need the card to return the calculation from Jan to Oct / 16 from Jan to Oct / 17. In the case would be the percentage of 13.37% (difference until October of each year)

 

medida YTD.jpg 

Hi @Anonymous,

How to get the 13.37? From your screenshot, the total value is -6.30% and the card display the same value, which is correct.

1.PNG

Best Regards,
Angelia

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.