cancel
Showing results for
Did you mean:
Highlighted
Frequent Visitor

Number Of Days in Quarter

Hello,

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

Accepted Solutions
Community Support Team

Re: Number Of Days in Quarter

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

3 REPLIES 3
Established Member

Re: Number Of Days in Quarter

Community Support Team

Re: Number Of Days in Quarter

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.

Community Support Team

Re: Number Of Days in Quarter

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

Announcements

Back to School Contest

Engage and empower students with Power BI!

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

PBI Community Highlights

Check out what's new in the Power BI Community!

Top Ideas
Top Kudoed Authors
Users Online
Currently online: 6 members 2,605 guests
Recent signins: