cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
iabarraganc Frequent Visitor
Frequent Visitor

calendar calculate Table

Hi

I created a calendar table from the application. When you need to search for values from previous months, using this table the measurement does not work. But if I import a table with dates the formula works without problems

 

ww

 

This is an example

 

YearMonthChargesV_CALENDAR_FUNCTIONV_TABLE_DATE
2018January806806 
2018February10481048806
2018March111311131048
2018April123712371113
2018May6606601237
2018June25782578660
2018July118211822578
2018August5215211182
2018September416416521
2018October576576416
2018November914914576
2018December14411441914
2019January  1441

 

V_CALENDAR_FUNCTION =

CALCULATE(SUM(hechos[Charges]);PARALLELPERIOD(DIM_FECHA_2[FECHA]; -1; MONTH))

uses the calendar table that is created with the dax function CALENDAR(START_DATE, FINISH_DATE).

 

And V_TABLE_DATE uses the table that was created in excel and then imported into Power BI (

CALCULATE(SUM('hechos'[Charges]);dateadd(DIM_FECHAS[FECHA].[Date]; -1 ;month)))
 
Thansk for your help
1 ACCEPTED SOLUTION

Accepted Solutions
iabarraganc Frequent Visitor
Frequent Visitor

Re: calendar calculate Table

Thank you for your help. I tried in my file (in which you sent me works) does not work the calculation. Then I created a new file and used the function PARALLELPERIOD and there already the data were shown well.

3 REPLIES 3
Community Support Team
Community Support Team

Re: calendar calculate Table

Hi @iabarraganc 

 

You may try below measure.Attached file for your reference.

Last Month = CALCULATE(SUM(Table3[Sales]),DATEADD('Date'[Date],-1,MONTH))

1.png

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
iabarraganc Frequent Visitor
Frequent Visitor

Re: calendar calculate Table

Thank you for your help. I tried in my file (in which you sent me works) does not work the calculation. Then I created a new file and used the function PARALLELPERIOD and there already the data were shown well.

Community Support Team
Community Support Team

Re: calendar calculate Table

Hi @iabarraganc 

 

Glad to hear you've solved it, please accept your reply as solution to close this thread.

 

Regards,
Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.