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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It 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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.