Forum Discussion
arvindyadav
Post Partisan
7 years agoTotal value is not correct.
Hi Team,
I am getting total value Incorrect.
The total value display in power bi for the entire month of the previous period but I need only total value for the previous period for current date matching.
Please find measure for the previous period:
previous period =
Previous Period Profit = CALCULATE(SUM(Table1[Profit]),SAMEPERIODLASTYEAR(Table1[Date]),ALL('Table1'))
and measure for current month :
This Month Profit = CALCULATE(SUM(Table1[Profit]),FILTER(Table1,YEAR(Table1[Date])=YEAR(TODAY()) && MONTH(Table1[Date])=MONTH(TODAY())))
The total of Previous period profit displaying from 7/1/2018 to 7/31/2018 i.e, $412025.00 but I need to correct the profit to display as 7/1/2018 to 7/28/2018 i.e, the profit is $37300.13.
Thanks,
Arvind
12 Replies
- v-xicai
Community Support
Hi arvindyadav ,
You can try to create a measure like DAX below.
Previous Period Profit = CALCULATE(SUM(Table1[Profit]),DATEADD(Table1[Date],-12,MONTH))
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- arvindyadav
Post Partisan
Hi v-xicai ,
Can you please read the Message once again I have made changes. your Dax is not works for me.
The result I am getting after applying your measure is:
- arvindyadav
Post Partisan