The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi,
I would like some help with a measure for the stacked column chart(on the photo).
This is the case: Measure 1 is working fine, it calculates the sales for last x days according the selection in the date filter (date table).
But Measure 2 is not working correctly, it should calculate the total sales for that whole month but previous year. (not lookin at the last x days).
Can you please help.
Thank you.
Solved! Go to Solution.
Hi @AnaStone_100 ,
Please try the following formula:
Measure2 =
CALCULATE (
SUM ( 'Table'[Value] ),
DATEADD ( PREVIOUSMONTH ( Dates[Date] ), -11, MONTH )
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @AnaStone_100 ,
Please try the following formula:
Measure2 =
CALCULATE (
SUM ( 'Table'[Value] ),
DATEADD ( PREVIOUSMONTH ( Dates[Date] ), -11, MONTH )
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hey @AnaStone_100
we need mor info about your case
how your Measure looklike?
In the meantime from my understand look at this logic it is supposed to solve the problem
Thanks for the reply,
Well, for Same period last year that is the logic, but as i meantioned I want to exclude the date filter last x days. So using only this DAX is not working:
Measure 2 = CALCULATE([Your Total sales],DATEADD('Date'[Date],-1,Year)) , it doesnt solve the problem.
MyMeasure 1 is more complex beacuse it takes orders created last x days(slicer) according to the filter and displays values for the sales for each month.
If I do not see your formula
It's hard for me to know how to put things together
I would love for picture or the Measure itself
If I understand you correctly then
try to put that after the CALCUKATE