Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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?
I think it will be option 1 cos the question is about percentage increase over last year = (Current Year - Last Year )/ Last Year
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
Hi buddy,
i think you are on the rigth path, take a look.
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...
@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.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
64 |
User | Count |
---|---|
135 | |
120 | |
101 | |
71 | |
61 |