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.
I have data from March to August. Every other month is missing data. I want to look for the average number of tickets per month as a KPI but only with the months with data in it.
Hi GenericUser1,
As a general solution, you may create a measure using DAX like pattern below and check if it can meet your requirement:
Average Value Per Month = CALCULATE ( AVERAGE ( Table[Number of Tickets] ), ALLEXCEPT ( Table, Table[Month] ) )
Regards,
Jimmy Tao
This dax for some reason is returning the total number of tickets I have. The average should be around 30 something per month but I don't know how to get there without including months with no data in it.
AverageTicketsPerMonth = CALCULATE(
average(incidents[Number Of Tickets Column]),
allexcept('Calendar Date', 'Calendar Date'[MonthShort]
result:
341.
Is your MonthShort column by chance being sorted by another column? If so, include that column in your ALLEXCEPT as well.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingThis dax for some reason is returning the total number of tickets I have. The average should be around 30 something per month but I don't know how to get there without including months with no data in it.
AverageTicketsPerMonth = CALCULATE(
average(incidents[Number Of Tickets Column]),
allexcept('Calendar Date', 'Calendar Date'[MonthShort]
result:
341.
The AVERAGE() function ignores missing data. I just put test data in January, March, and July. Then I connected it to my Date table. Dropped teh month from the date table into a Table, then created this measure:
=AVERAGE(Tickets[Records])
The grid shrank to three rows - Jan/Mar/Jul, and hte average that was calculated is accurate.
I did not try this without a Date table. I alwys have a date table in my model.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingGood suggestion but I was hoping to use the average per month as a KPI so not in bar graph. I'm not looking for average in January, February etc... Just a general average per month if you get what I mean so using a card visual to check the overall average per month.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |