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.
I want to use a similar function than LOOKUPVALUE that works with measures.
My objective is to display the LAST year's value
I have a Dataset like this:
There is a relationship between the Two 'Date' collumns.
I use measures to compile data for a specific region (and other parameters in my full dataset):
I want to use the 'Date match + 1' as a reference to get the last year's value.
How can i do That ?
Hi @Anonymous
Could you provide a specific sample ? This can help us better deal with the problem .
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I've edited the main post, tell me if that is enough. I don't think i can link the exemple pbix ...
@Anonymous Can you give us an example where the result is wrong because of leap year and tell us what result you would like to have.
@Anonymous , Try measures like
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[Date]))
or for YTD
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
The problem is DATEADD and SAMEPERIODLASTYEAR are incorrect for me as they do not work with leap years AND my measure is a bit more complex than a SUM
Why will the SAMEPERIODLASTYEAR() not work? In what situation will it fail?
So when i tried:
Year behind Sales = CALCULATE([SalesMeasure]),SAMEPERIODLASTYEAR('Date'[Date]))
I don't get the same day of the week.
this makes next year look like this :
And it's shifted from what i want, i want the same day of the week; tuesday to tuesday.
The server i'm pulling my data from gives me the 'Next year corresponding day', that is correct for me, hence why i want to just match the collumn
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |