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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Bosh
New Member

Create Billing Periods

Good morning.

Among the data I enter into Power BI is a dd-mm-yy date column. But my final reports require an analysis based on "Billing Periods" that correspond from 26 month1 to 25 month2.

That is, perido April 2020, is defined from 26 March 2020 until 25 April 2020.

In excel I use the following formula to create a new column.

•YES(@O:O-";""; SI(DIA(@O:O)<26; DATE(YEAR(@O:O); MONTH(@O:O);1); DATE(YEAR(@O:O); MONTH(@O:O)+1;1)))

Where "O:O" it's the column that has the dates.

Which simpler options I can use in power BI to have Billing PERIODS.

I am very grateful for the suggestions.

1 ACCEPTED SOLUTION
v-zhenbw-msft
Community Support
Community Support

Hi @Bosh ,

 

We can create a calculate column to meet your requirement.

 

Column = 
var _month =MONTH('Table'[Date])
var _next_month = _month + 1
var _current_date = DATE(YEAR('Table'[Date]),_month,26)
var _next_date = DATE(YEAR('Table'[Date]),_next_month,25)
var _format1 = FORMAT(_next_date,"mmm")&" "&YEAR('Table'[Date])
var _format2 = FORMAT(_current_date,"mmm")&" "&YEAR('Table'[Date])
return
IF('Table'[Date]<_next_date && 'Table'[Date]>=_current_date,_format1,_format2)

 

CR1.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the pbix that we have shared?

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

BTW, pbix as attached.

View solution in original post

4 REPLIES 4
Bosh
New Member

Thank you very much for your input.

I got the expected result, using the following formulas:

PERIODO = if(day(Tabla1[Date])<26, DATE(YEAR(Tabla1[Date]), MONTH(Tabla1[Date]), 1), DATE(YEAR(Tabla1[Date]), MONTH(Tabla1[Date])+1, 1))
v-zhenbw-msft
Community Support
Community Support

Hi @Bosh ,

 

We can create a calculate column to meet your requirement.

 

Column = 
var _month =MONTH('Table'[Date])
var _next_month = _month + 1
var _current_date = DATE(YEAR('Table'[Date]),_month,26)
var _next_date = DATE(YEAR('Table'[Date]),_next_month,25)
var _format1 = FORMAT(_next_date,"mmm")&" "&YEAR('Table'[Date])
var _format2 = FORMAT(_current_date,"mmm")&" "&YEAR('Table'[Date])
return
IF('Table'[Date]<_next_date && 'Table'[Date]>=_current_date,_format1,_format2)

 

CR1.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the pbix that we have shared?

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

BTW, pbix as attached.

Hello @Bosh , thank you for posting this, this helped me also. 


@v-zhenbw-msft Thank you for your solution. Just additional inquiry, would it be possible to make it as a DATE format and not as TEXT? But still the same "mmm YYYY"? Thank you so much!

Greg_Deckler
Community Champion
Community Champion

@Bosh - Those same functions are in DAX, MONTH, DATE, YEAR, etc. I would probably create a custom column in a date table where you would calculate the billing period for the dates. You could then use that in a slicer.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.