Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
iabarraganc
Helper I
Helper I

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

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.

View solution in original post

3 REPLIES 3
v-cherch-msft
Employee
Employee

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.

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.

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.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.