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
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!:
The Definitive Guide to Power Query (M)

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
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.