Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Average per category and date

Hi all. I think this was already discussed but none of the topic solutions seem to work for me.

I am looking for a measure (wonder if possible to have a calculated column version as well? ) which would calculate average value per category (in my example C1, C2, C3, C4) and date. I am using line and clustered line chat visual. What I got so far it gives me the average value but it does not mind that some months have only 3 categories. So for the 2020-07 I expect average value to be 6.Category.PNG

 

3 REPLIES 3
daxer-almighty
Solution Sage
Solution Sage

You probably mean: "...that returns the average over the selected/visible categories for any selected period of time." Right? "An average value per category" means, according to my understanding, that you'd want to calculate an average (over something, maybe days) for any specific category.

 

Here's a possible measure...

 

[Average Over Categories] =
calculate(
    averagex
        distinct( T[Category] ),
        [your_measure_here]
    ),
    allselected( T )
)
Anonymous
Not applicable

@daxer-almighty might be you're more accurate though I thought date might also be category 🙂 in any case - if you have any suggestions would appreciate.

@Anonymous 

 

Well, you can't write a measure that does everything. You have to clearly define what type of average you want since it's not possible to have a measure that averages over several different entities. So, you can have an average over time or over categories. You can't have one that averages over categories or/and time. How would you then know which average to take if both categories and time are present in the visual? Of course, you could specify a rule to say when each type of average you'd like to see but... nobody does such logical stunts as it would be very hard to interpret/remember and read by the end users. So, either an average over categories or over time. Tertio non datur.

 

A possible measure is above...

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors