Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hi Team,
I tried differet ways to get Average for the below data but was not possible to get the Dax foumula. Could some one help me in cracking this problem.
I have two columns named Checking as First column and First date Min as Second Column.
Problem - I need to get average by considering the First date Min column first row data in Checking column
Below is the example
It need to get average as below
Solved! Go to Solution.
Hi,
Thanks for the solution freginier and MFelix offered, and i want to offer some more information for user to refer to.
hello @manubk , you can refer to the follwing solution.
Sample data:
Create a measure
MEASURE =
VAR a =
CALCULATETABLE (
DISTINCT ( 'Table'[First date min] ),
FILTER ( ALLSELECTED ( 'Table' ), [End MY] IN VALUES ( 'Table'[End MY] ) )
)
VAR b =
SELECTCOLUMNS (
FILTER ( ALLSELECTED ( 'Table' ), [End MY] IN VALUES ( 'Table'[End MY] ) ),
"Test", [Chencking]
)
RETURN
AVERAGEX ( UNION ( a, b ), [First date min] )
Then create a measure and put the following field to it.
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-xinruzhu-msft Thank you soo much.. This is how i wanted the soultion.. Big kudos to you
@MFelix @freginier Thank you so much for your reply .. I just need the Average as below.. there is one more coulmn which indicates the month as End MY as shown below. The average needs to consider based on month. Giving you 3 examples
Jan Month
Should receive average as below
December Month
Should be
November Month
Hi,
Thanks for the solution freginier and MFelix offered, and i want to offer some more information for user to refer to.
hello @manubk , you can refer to the follwing solution.
Sample data:
Create a measure
MEASURE =
VAR a =
CALCULATETABLE (
DISTINCT ( 'Table'[First date min] ),
FILTER ( ALLSELECTED ( 'Table' ), [End MY] IN VALUES ( 'Table'[End MY] ) )
)
VAR b =
SELECTCOLUMNS (
FILTER ( ALLSELECTED ( 'Table' ), [End MY] IN VALUES ( 'Table'[End MY] ) ),
"Test", [Chencking]
)
RETURN
AVERAGEX ( UNION ( a, b ), [First date min] )
Then create a measure and put the following field to it.
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-xinruzhu-msft Thank you soo much.. This is how i wanted the soultion.. Big kudos to you
Hey there!
To calculate the average for the dataset, try using this DAX function: AverageValue =
VAR FirstRowValue = FIRSTNONBLANK( TableName[Checking], 1 )
VAR TotalSum = SUM( TableName[Checking] ) + FirstRowValue
VAR TotalCount = COUNT( TableName[Checking] ) + 1
RETURN
TotalSum / TotalCount
Hope it works!
Zoe 😁😁
Hi @manubk ,
How do you have this two columns in terms of the model? Do you only want to get the average value or do you also need to get the lines as you show in the image?
Can you give a litle bit more context on the way the data is setup please.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsMarch 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
118 | |
116 | |
71 | |
64 | |
46 |