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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Ejykso
Helper I
Helper I

Custom Date Period

Hi All,

 

I have a problem with my custom date period. 

I'm using this:

var _today = today()

Return 

union ( 
addcolumns (

calendar(date(year(_today), month (_today), 1), _today)

,"type", "mtd", "order", 1

), 

addcolumns(

calendar(date(year(today),quarter(_today),1), _today)

,"type", "qtd", "order", 2

However, my qtd is not working but my mtd is working.  QTD is starting from feb which is not correct. 

 

Thanks for your help. 

 

2 REPLIES 2
FreemanZ
Super User
Super User

hi @Ejykso 

try like:

Table = 
var _today = today()
VAR _quarterstart = 
DATE(
    YEAR(_today), 
    (QUARTER(_today)-1)*3+1,
    1
)
Return
union (
    addcolumns (
       calendar(date(year(_today), month (_today), 1), _today),
        "type", "mtd",
        "order", 1
    ),
    addcolumns(
        CALENDAR(_quarterstart, _today),
        "type", "qtd",
        "order", 2
    )
)

 

it worked like:

FreemanZ_0-1682001532175.png

 

it would be easier with Time Intelligence Functions. 

ppm1
Solution Sage
Solution Sage

Why do you need to union these tables as it looks like they overlap?  In any case, here is a way to get a date range from the start of the current quarter.

 

 CALENDAR ( DATE ( YEAR ( _today ), FLOOR(MONTH ( _today ),3)+1, 1 ), _today )
 
Pat
 
Microsoft Employee

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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