cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
tulasi_pbi1988 Frequent Visitor
Frequent Visitor

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

Accepted Solutions
Community Support Team
Community Support Team

Re: Number Of Days in Quarter

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

3 REPLIES 3
mussaenda Established Member
Established Member

Re: Number Of Days in Quarter

Community Support Team
Community Support Team

Re: Number Of Days in Quarter

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.

 

Community Support Team
Community Support Team

Re: Number Of Days in Quarter

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

Helpful resources

Announcements
Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

PBI Community Highlights

PBI Community Highlights

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

Top Ideas
Users Online
Currently online: 6 members 2,605 guests
Please welcome our newest community members: