Forum Discussion

KhyatiBirje's avatar
KhyatiBirje
New Member
8 years ago

average by category

Hello,

How can I calculate the average by variable sub-category and date together?

 

The sample data is :

DayRequest-typerequest type counthours used
31-MarFrench423.4
31-MarGerman15.85

 

Here, I want the average of hours used based on request type i.e. for 31-Mar French, the average should be (23.4/4 = 5.85). By changing the variable hours used into average hours used  gives an incorrect value.

Because there are multiple entries of days the average Power BI is calculating is at an overall data level.

 

I am not able to achieve the desired result by simple calculation or by using DAX formula.

 

hours_used_today average per Request Type = 
AVERAGEX(
	KEEPFILTERS(VALUES('Dummy data'[Request Type])),
	CALCULATE([hours_used_today]))

The data has Request-Type spread across various days.

 

Can anyone help me with this ?

 

1 Reply

  • Phil_Seamark's avatar
    Phil_Seamark
    Microsoft Employee

    Hi KhyatiBirje

     

    Can you please post a little more data.  Perhaps a mockup of what your data looks like so we can get a better understanding of your requirement.