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.
Hi the community,
Like many of you, I try to compare billing amounts from year to year.
I used the "sameperiodlastyear" function but even if the calculation looks good, the values are not displayed in the associated column.
My formula :
Can you please explain to me why this is not working ?
Thanks in advance
Solved! Go to Solution.
Hi,
Hello,
Thank you again for your answers.
By digging into the idea of filtering, I found a solution on the Internet in 2 steps:
1 calculated column : LastYear = DATEADD(Calendar[Date];-1;year)
and 1 measure : CALCULATE(
SUM(LIGNES_FACT[LFC_FACTURE_CONSOLIDEE]);
FILTER(
All(Calendar);
CONTAINS(VALUES(Calendar[Last Year]);Calendar[Last Year];Calendar[Date])
)
)
Hi,
Hello,
Thank you again for your answers.
By digging into the idea of filtering, I found a solution on the Internet in 2 steps:
1 calculated column : LastYear = DATEADD(Calendar[Date];-1;year)
and 1 measure : CALCULATE(
SUM(LIGNES_FACT[LFC_FACTURE_CONSOLIDEE]);
FILTER(
All(Calendar);
CONTAINS(VALUES(Calendar[Last Year]);Calendar[Last Year];Calendar[Date])
)
)
Thank you for yours answers.
I do have a clean date table.
But unfortunately no solution works, I have the same result each time ...
Hi,
Thank you for your feedback.
If it is OK with you, please share your sample pbix file's link, then I can try to look into it to find a way.
Thank you.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hey @AlexisPREVOT ,
do you have a proper date dimensional table where each day in the desired time area (including weekends) appears once?
If that is the case did you mark it as data table?
If that is not the case try to add an ALL in you calculation:
TotalPREC =
CALCULATE(
SUM( LIGNES_FACT[LFC_FACTURE_CONSOLIDEE] ),
SAMEPERIODLASTYEAR( FACTURES[FCC_DATE] ),
ALL( FACTURES[FCC_DATE] )
)
All of the time intelligence functions only work with a proper date table.
Hi, @AlexisPREVOT
Please correct me if I wrongly understand your question.
I think there are some limitations in using sameperiodlastyear.
https://docs.microsoft.com/en-us/dax/sameperiodlastyear-function-dax
Instead, please try to use DATEADD DAX function.
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |