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
Anonymous
Not applicable

Average number of tickets per day

Hi All,

 

I'd like to graph the average number of tickets by weekday over each week

 

 Date ,    number of tickets ,                             AVG

01-01 ,                 20     ,                                    20

02-01 ,                 30     ,                                    25

03-01 ,                 25     ,                                    25

04-01 ,                 40     ,                                    28,75

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

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario.

Test:

a1.png

 

You may create a measure as below.

AVG = 
var _date = SELECTEDVALUE('Test'[Date])
return
AVERAGEX(
    FILTER(
        ALLSELECTED(Test),
        Test[Date]<=_date
    ),
    Test[num of tickets]
)

 

Result:

a2.png

 

Best Regards

Allan

 

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

7 REPLIES 7
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario.

Test:

a1.png

 

You may create a measure as below.

AVG = 
var _date = SELECTEDVALUE('Test'[Date])
return
AVERAGEX(
    FILTER(
        ALLSELECTED(Test),
        Test[Date]<=_date
    ),
    Test[num of tickets]
)

 

Result:

a2.png

 

Best Regards

Allan

 

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

Anonymous
Not applicable

I found the solution for this matter 🙂 Thank you very much for your supporting 🙂
 
AVG =
var _date = SELECTEDVALUE(Tickets[Creatietijd])
return
AVERAGEX(
SUMMARIZE (
FILTER(
ALLSELECTED('Tickets');
'Tickets'[Creatietijd] <= _date

);
Tickets[Creatietijd]
);
Tickets[Total Tickets]
)
Anonymous
Not applicable

I am getting this results.

 

Do you know what is going wrong here?

Anonymous
Not applicable

@Anonymous Replace semicolon with comma. 

Anonymous
Not applicable

I did, but I am getting the same result

Anonymous
Not applicable

AVF_tnum_tickets.png

 

Hi @v-alq-msft  When I execute this measure I am getting the following result:

 
 

 

AVG =
var _date = SELECTEDVALUE('Tickets'[Creatietijd])
return
AVERAGEX(
FILTER(
ALLSELECTED(Tickets);
Tickets[Creatietijd] <=_date
);
Tickets[Total Calls] (this is a measure)
)
 
 
 
 

Capture.PNG

 

amitchandak
Super User
Super User

In case you want daily Avg to reset at week. Then look at WTD in the given file and use Average Aggregation.

If you are looking for weekly Avg Then use like

 CALCULATE(Average(Sales[Net Sales]),FILTER(all('Date'), 'Date'[Week Rank]<=max('Date'[Week Rank])))

https://www.dropbox.com/s/d9898a48e76wmvl/sales_analytics_weekWise.pbix?dl=0

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.