Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
Hi Guys,
I want the average from a time Period.
In one Table i have 2 Rows like this:
Date: Values:
01.01.2016 100
01.01.2016 50
01.01.2016 10
01.02.2016 50
01.02.2016 50
01.02.2016 20
If i creat visuals with average i only get the full average of all data ( 46,6666)
but i need it per Month '
average 01/2016 = 53,33
02/2016 = 40
I tryed a lot of things with the little DAX i know but nothing worked out correctly.
thank you in advance
Solved! Go to Solution.
Hi Mertsch,
I have tested it on my local environment, you can add calculated column to display the month name using the DAX below
Month = MONTH(MonthAverage[Date])
And then create a measure
MeasureAverage = SUM(MonthAverage[Total])/DISTINCTCOUNT(MonthAverage[Month])
Regards,
Charlie Liao
Hi All, (funny I came here for an average per month of a sum - which is elluding me)...
However I deal with dates and odd data a lot, supprised you guys are having an issue...
So a percentage is numerator/denominator (then click on the % in your column tools) easy enough... but over time can be an issue. So lets say you create a simple % measure, but wan tot look at it over time. (say Month to date, last month and year to date).
1) in your hospital data duplicate your date column and make sure its set as "date" in formatting
2) if you dont have a date table click on modelling 'New Table' and paste this in:
I have the quantity of employee per month, need to calculate the average per month
Final Qty Average per month
January :100 100
February: 120 110
March: 90 105
April :: 100 95
Average= (Qty 1+Qty)/2
i am struggling with this , if someone can help me, 🙂 😞
edit: sorry i explane it wrong....
what i need is:
the final average:
01/2016 = Sum 160
02/2016 = Sum 120
average: 140
Try creating a calculated column like:
Month = MONTH([Date])
Then add your Average measure and Month to a table.
Looks like you want to get the average by Summing the amount and dividing it by the number of months/distinct dates rather than dividing by the number of rows.
This might help, write following DAX measures:
Amount=SUM([Values])
NumOfDistinctDates=DISTINCTCOUNT([Date])
Avg=DIVIDE([Amount],[NumOfDistinctDates])
nikil
Check out the Chicagoland Power BI User Group
Hey,
I have one more question here, i ahave one Power Bi template, which has Hours by month Operating Group wise.
Cureently in Power Bi i am using Matrx visual for this and i have the data from February 2018 to December 2018, i .e for 10 months.
But when i used the formual
Simple & Effective solution. Cheers
well it wokrs for the full tabel but if i used filters it dont work for it.
( 140 is correct for all data )
But after using Filters it will be still 140. it need to be 60 in that case
There must be a other way to have it more flexible with using filters
The data need to be calculated acording to the used filters and visual in front end.
May it works with GROUPBY Month Dates?! But i dont get the DAX work
= GROUPBY (Tabelle1;Tabelle1[Month];“TEST2”;SUM(CURRENTGROUP();Tabelle1[Total]))
Hi Mertsch,
I have tested it on my local environment, you can add calculated column to display the month name using the DAX below
Month = MONTH(MonthAverage[Date])
And then create a measure
MeasureAverage = SUM(MonthAverage[Total])/DISTINCTCOUNT(MonthAverage[Month])
Regards,
Charlie Liao
Thanks, this helps.
But, I have a slightly different scenario.
I am looking at tickets closed by users in a date range.
In report, say, I selected the Closed Date Range as 1/Aug - 31/Jan (6 Months)
Now, I am facing the following mismatch.
User | Tickets Closed | Distinct Closed Months | Calculated Average | Actual Average |
A1 | 5 | Aug2021, Sep2021, Oct2021, Jan2022 | 5/4=1.25 | 5/6=0.83 |
A2 | 3 | Aug2021, Sep2021 | 3/2=1.5 | 3/6=0.5 |
These users worked all six months - but they closed no tickets in some months. Still the average is showing better than actual.
How do I rectify this?
This does not work if the data covers a period longer than a year as multiples will appear over multiple years, is there another way?
substitute the followign for the month formula: =format([date], "YYYYMM")
Hi,
I am a beginner in Power BI. I want to arrive at % of surgeries performed by each doctor for the month. i. e. total surgeries by a doctor in a month DIVIDED BY total surgeries in the month.
When I used the solution in a measure as "MonthlySurgeries = sum(tblReportPaed[Surgeries])/DISTINCTCOUNT(tblReportPaed[MonthNumber])" it generates an error at the bottom of the screen which reads as "TABLE: tblReportPaed (92 Rows) COLUMN: Measure (0 distinct values)".
Where am I going wrong?
Appreciate in advance.
Hi
I have similar report but it has 3 years data.
I'm looking for average calculation as below
=total year production value/no. of months
kindly provide solution
Hi,
What if we want to use this measure with a date drill down, how would it work?
Fernando
Thats what im looking for !
Thanks a lot !
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.