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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Get total num of days in the Quarter

Hi, I have a table that looks like this and I want to create a measure to get the total number of days in the quarter (i.e. FY21-Q4) which is 30+31+30 = 91. Does anyone know how I can get 91?

 

FYI, Fiscal Quarter is a slicer in my dashboard page

beekee_0-1619112327031.png

 

Regards,
BK

 

 

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

Hi @Anonymous ,


You could create a calendar, then extract his FY-QUARTER column, and finally COUNT the rows of quarter, create measures by the following formula:
First create table:

Newtable = CALENDARAUTO(6)

v-yalanwu-msft_0-1619516800161.png

Then create column:

FY-Qua = "FY"&RIGHT(IF(MONTH([Date])>=7,YEAR([Date])+1,YEAR([Date])),2)&"-Q"&SWITCH(QUARTER([Date]),3,1,4,2,1,3,2,4)

Last create measure:

Quartertotal = CALCULATE(COUNTROWS('Newtable'),FILTER('Newtable',[FY-Qua] in VALUES('Table'[Fiscal Quarter])))

The final output is shown below:

v-yalanwu-msft_1-1619516827755.pngv-yalanwu-msft_2-1619516836743.png


Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi @Anonymous ,


You could create a calendar, then extract his FY-QUARTER column, and finally COUNT the rows of quarter, create measures by the following formula:
First create table:

Newtable = CALENDARAUTO(6)

v-yalanwu-msft_0-1619516800161.png

Then create column:

FY-Qua = "FY"&RIGHT(IF(MONTH([Date])>=7,YEAR([Date])+1,YEAR([Date])),2)&"-Q"&SWITCH(QUARTER([Date]),3,1,4,2,1,3,2,4)

Last create measure:

Quartertotal = CALCULATE(COUNTROWS('Newtable'),FILTER('Newtable',[FY-Qua] in VALUES('Table'[Fiscal Quarter])))

The final output is shown below:

v-yalanwu-msft_1-1619516827755.pngv-yalanwu-msft_2-1619516836743.png


Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

Get a distinct list of "week"  values (which actually seem to be months), then get the average of days for each of them, and finally add them up.

 

Or, use a proper calendar table based on days, not on weeks.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.