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, im writting to see if any of you can help me with my volumen report.
I am trying to compare the volume of the year 2020 with the year 2019 with the SamePeriodLastYear measure however the measure is not bringing me the values of 2019 ... the strange thing is that works when i compared the volume of 2019 the measure brings me the values of 2018 ... what may be missing?
I think something in the formula may be wrong.. there is just this table
CALCULATE([Volume];SAMEPERIODLASTYEAR('Tabla calendario'[Date]))
Solved! Go to Solution.
HI @Anonymous
The problem is that there is a filter in 'Maestro CeCo'[Tipo Material]
and in the relationship that there is a wrong logic in it.
you could not use "both" between 'Forecast 2019' and 'Tabla calendario', but the relationship is many to many, so you could just adjust the relationship as below:
Step1:
Add a dim Year table
DIM year = SUMMARIZE('Tabla calendario','Tabla calendario'[año])
Step2:
Use this dim year table as a bridge table to create a relationship between 'Forecast 2019' and 'Tabla calendario' as below:
Note: cross filter direction between 'Tabla calendario' and 'Dim year' is "Both'
Result:
By the way, for the built-in date hierarchy of power bi, you'd better use [año] field instead of year hierarchy year of [date] field.
and here is sample pbix file, please try it.
Regards,
Lin
hi @Anonymous
Just add just the formula as below:
New Measure = CALCULATE( CALCULATE([Volume],SAMEPERIODLASTYEAR('Tabla calendario'[Date])),ALL('Tabla calendario'[Date]))
Result:
and here is simple sample pbix file, please try it.
Regards,
Lin
Hi,
I tried with the solution but i still seeing the same results... maybe it is the volume base or the calendar table?
* The mesure toneladas.reales is the volume mesu
Try, like this
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year)))
If it does not work. If possible please share a sample pbix file after removing sensitive information.Thanks.
My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
Hi, you can find the pbi file here:
https://drive.google.com/open?id=1XbHnR9ugvEkkboaI9esnSjioys0BJQeI
Thanks in advance.
HI @Anonymous
The problem is that there is a filter in 'Maestro CeCo'[Tipo Material]
and in the relationship that there is a wrong logic in it.
you could not use "both" between 'Forecast 2019' and 'Tabla calendario', but the relationship is many to many, so you could just adjust the relationship as below:
Step1:
Add a dim Year table
DIM year = SUMMARIZE('Tabla calendario','Tabla calendario'[año])
Step2:
Use this dim year table as a bridge table to create a relationship between 'Forecast 2019' and 'Tabla calendario' as below:
Note: cross filter direction between 'Tabla calendario' and 'Dim year' is "Both'
Result:
By the way, for the built-in date hierarchy of power bi, you'd better use [año] field instead of year hierarchy year of [date] field.
and here is sample pbix file, please try it.
Regards,
Lin
Thanks a lot !
Just check, if your visual is restricted dates of 2020 and for the same dates you do not have data 2019.
Also check
https://community.powerbi.com/t5/Desktop/SAMEPERIODLASTYEAR-not-working-as-expected/m-p/138016
I usually use
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year)))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year))))
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 |
---|---|
107 | |
94 | |
77 | |
63 | |
50 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |