The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Dear,
I have couple of DAX written in my model, now i want to calculate average for specific items over this measure. As you know Average DAX is taking only table column and not the measure. Please guide me on how to take average over this below measure.
Main Measure : Need average over this Sum of Net Delivery Measure.
Solved! Go to Solution.
Hello @DivakarKrishnan , Not very clear about the category over which you want to calculate the Average, but you can refer that category in your DAX, somewhat like below DAX.
DAX = AVERAGEX( KEEPFILTERS( VALUES( 'Your_Table'[Category_Field] ) ), CALCULATE( [Sum of Net Delivery] ) )
where, 'Sum of Net Delivery' is your Main measure.
Let me know, if this works.
If I answer your question, please mark my post as solution, this will also help others.
[Avg Over Items] =
averagex(
values( ItemsDimension[ItemId] ),
// Please note that if
// [your measure] = BLANK() for
// some ItemId, then this value
// will NOT be taken into account.
// If you want to treat BLANK() as
// 0 and do include it in the calculation
// you have to add 0 to the measure:
// [your measure] + 0
[your measure]
)
Hello @DivakarKrishnan , Not very clear about the category over which you want to calculate the Average, but you can refer that category in your DAX, somewhat like below DAX.
DAX = AVERAGEX( KEEPFILTERS( VALUES( 'Your_Table'[Category_Field] ) ), CALCULATE( [Sum of Net Delivery] ) )
where, 'Sum of Net Delivery' is your Main measure.
Let me know, if this works.
If I answer your question, please mark my post as solution, this will also help others.
Thanks for your response.
I tried the below code and it's working. Thanks a lot..
User | Count |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
21 | |
12 | |
10 | |
7 |