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

Number Of Days in Quarter

Hello,

 

Could anyone please help me creating a number of days in a quarter.

 

I have a scenario to calculate the sales divided by a number of days in the selected quarter.

 

For Example,

I have the table visual consist of date column, sales amount per each date. Now, I need to create a column to show (Sales Amount/Days in the fiscal quarter).

If the user selects 19Q1 and 19Q3 then the number of days should be 181

For 19Q1 related dates sales amount should be divided by 91(number of days in this quarter)

For 19Q3 related dates sales amount should be divided by 89((number of days in this quarter).

 

Thank you!

 

 

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi  @tulasi_pbi1988 ,

 

Does that make sense? If so, kindly mark my answer as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.

 

Best regards

Amy

View solution in original post

3 REPLIES 3
v-xicai
Community Support
Community Support

Hi  @tulasi_pbi1988 ,

 

Does that make sense? If so, kindly mark my answer as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.

 

Best regards

Amy

v-xicai
Community Support
Community Support

Hi @tulasi_pbi1988 ,

 

Assuming the column which contains 19Q1 and 19Q3 is called [Year & Quarter], then you can create measure like DAX below.

 

Average sales for Quarter= DIVIDE(CALCULATE(SUM(Table1[sale]),FILTER(ALLSELECTED(Table1), Table1[Year & Quarter] =MAX(Table1[Year & Quarter]))) ,CALCULATE(COUNT(Table1[Date]),FILTER(ALLSELECTED(Table1), Table1[Year & Quarter] =MAX(Table1[Year & Quarter]))))

 

Best Regards,

Amy

 

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

 

mussaenda
Super User
Super User

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.