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

Create a measure to calculate the percentage that the total Sales value increased since one year ago

I need to create a measure to calculate the percentage that the total Sales value
increased since one year ago.
Which DAX formula should I use?

(sum(Sales[Value])
–CALCULATE(sum(Sales[Value]),SAMEPERIODLASTYEAR(‘Date’[Date])))/CALCULATE
(sum(Sales[Value]),SAMEPERIODLASTYEAR (‘Date’ [Date]))


sum(Sales[Value])-CALCULATE(sum(Sales[Value]),SAMEPERIODLASTYEAR
(‘Date’ [Date]))

 

CALCULATE(sum(Sales[Value]),SAMEPERIODLASTYEAR (‘Date’
[Date]))/sum(Sales[Value])

 

I have a sales table and date table.

 

which is correct?

6 REPLIES 6
Anonymous
Not applicable

I think it will be option 1 cos the question is about percentage increase over last year = (Current Year - Last Year )/ Last Year

alexvc
Resolver I
Resolver I

I've used this formula:

 

%Inc Sales = SUM(Sales[Value])/CALCULATE(SUM(Sales[Value]),DATEADD('Date'[Date],-1,YEAR))-1

 

Let me know if it works

Anonymous
Not applicable

Hi buddy,

 

i think you are on the rigth path, take a look.

 

Inc_Year = SUMX(Table;SUM(Table[Value])-CALCULATE(SUM(Table[Value]);SAMEPERIODLASTYEAR(Table[Date]))/SUM(Table[Value]))
 
you can also create a column that bring only the year of the date e then try to use this column as "filter" for your measure.
 
Any questions, ask 😉
Greg_Deckler
Super User
Super User

See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...


@ 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


@Greg_Deckler wrote:

See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...


 

Please can you help selecting correct one from below 3?

(sum(Sales[Value])
–CALCULATE(sum(Sales[Value]),SAMEPERIODLASTYEAR(‘Date’[Date])))/CALCULATE
(sum(Sales[Value]),SAMEPERIODLASTYEAR (‘Date’ [Date]))


sum(Sales[Value])-CALCULATE(sum(Sales[Value]),SAMEPERIODLASTYEAR
(‘Date’ [Date]))

 

CALCULATE(sum(Sales[Value]),SAMEPERIODLASTYEAR (‘Date’
[Date]))/sum(Sales[Value])

Hi,

The second one will give the correct absolute number.  To convert it to %, try this

=IFERROR(sum(Sales[Value])/CALCULATE(sum(Sales[Value]),SAMEPERIODLASTYEAR(‘Date’ [Date]))-1,BLANK())

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.