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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dykesn92
Regular Visitor

Using this period/last period/year ago when a period is 28 days not a month

My company reports in 28 day periods instead of months.

 

Currently I have my period calendar in one file "PeriodCalendar" and everything else in a file called  "Data Dump"

 

While I can link the queries I have also created a merged column:

 

= Table.ExpandTableColumn(#"Merged Queries", "PeriodCalendar", {"Period (L)"}, {"PeriodCalendar.Period (L)"})

 

I am trying to also create a field called last period. (And then in turn same period last year).

 

to do this I created a calculated field and then create another merge field.

 

= Table.AddColumn(#"Expanded PeriodCalendar", "Custom.1", each Date.AddDays([Date], -28))

 

The problem is that while this works it means I have to create 2 new columns for every version of last period that I want.

 

I was wondering if there was a more effiecient way of doing  this.

 

 

4 REPLIES 4
dramus
Continued Contributor
Continued Contributor

What does your PerodCalendar look like, what fields do you have?

Hi Dramus,

 

 

Just Date and period where date is every day in a format of dd/mm/yyyy and the period is PX YY

 

Thanks

 

Nick

dramus
Continued Contributor
Continued Contributor

Previous Period = lookupvalue('Period Dates'[Period],'Period Dates'[Date],dateadd('Period Dates'[Date],-28,DAY))

Same Period Previous Year = lookupvalue('Period Dates'[Period],'Period Dates'[Date],dateadd('Period Dates'[Date],-1,YEAR))

 

Does this help?

dykesn92
Regular Visitor

My company reports in 28 day periods instead of months.

 

Currently I have my period calendar in one file "PeriodCalendar" and everything else in a file called  "Data Dump"

 

While I can link the queries I have also created a merged column:

 

= Table.ExpandTableColumn(#"Merged Queries", "PeriodCalendar", {"Period (L)"}, {"PeriodCalendar.Period (L)"})

 

I am trying to also create a field called last period. (And then in turn same period last year).

 

to do this I created a calculated field and then create another merge field.

 

= Table.AddColumn(#"Expanded PeriodCalendar", "Custom.1", each Date.AddDays([Date], -28))

 

The problem is that while this works it means I have to create 2 new columns for every version of last period that I want.

 

I was wondering if there was a more effiecient way of doing  this.

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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