Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi;
I want to calculate the cumulative of sales quantity of the previous 5 months without counting the current also I want it to be dynamic depending on the current month.
Data example bellow
Solved! Go to Solution.
Hi,
Drag this measure to a card visual
=CALCULATE([Cantidad],DATESBETWEEN(Calendar[Date],EDATE(EOMONTH(TODAY(),-1)+1,-5),EOMONTH(TODAY(),-1)+1))
Hope this helps.
Hi,
Drag this measure to a card visual
=CALCULATE([Cantidad],DATESBETWEEN(Calendar[Date],EDATE(EOMONTH(TODAY(),-1)+1,-5),EOMONTH(TODAY(),-1)+1))
Hope this helps.
It Works, thank you.
You are welcome.
Hi @Anonymous ,
Try the following measure:
Sum Last 5 Months = CALCULATE ( SUM ( 'Table'[Quantity] ); DATESINPERIOD ( 'Table'[Date]; MAX ( 'Table'[Date] ); -6; MONTH ) ) - SUM ( 'Table'[Quantity] )
Replace the table name by the your data. If the date column is on a different table just change also that column to the correct one.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsIt doesn't work because I have a data since 2016.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português