Forum Discussion
Total in bar graph and table is wrong
- 4 years ago
Try this measure:
Previous Year = SUMX ( 'Fecha table', CALCULATE ( [Sum Venta], DATEADD ( 'Fecha table'[Date], -1, YEAR ) ) )
It looks like you are using fields from an automatic date hierarchy. You should be using the fields from the Fecha table (which btw you should mark as the date table if you haven't)
Hey Paul,
I marked as data table and lost the hierarchy; then I did my own using Fecha as a hierarchy “root”, and manually add year, month, and day, but the results were exact same thing; in the daily view, the day shows the correct amount, and same thing than the table but once I build my own hierarchy and show monthly results, I got the wrong result.
Besides that, even if I don’t use hierarchy, only “Fecha” (marked as date Table), got same wrong result $5,564,885.04 instead of $1,731,496.46:
- PaulDBrown4 years agoCommunity Champion
Can you share some sample data (non-confidential) please?
- Abevann4 years agoHelper III
Sure, I'll clean up the data and then send it, thanks
- Abevann4 years agoHelper III
There you go, thanks!
https://1drv.ms/x/s!AlLivjsApnMZhK5AhdooEGIAMAMZlg?e=PlWztb
With this data, I have this simple GUI, with same results, the sum is $5,564,885.04; if I filter up to May 12, the sum is correct.
- PaulDBrown4 years agoCommunity Champion
Try this measure:
Previous Year = SUMX ( 'Fecha table', CALCULATE ( [Sum Venta], DATEADD ( 'Fecha table'[Date], -1, YEAR ) ) )