Forum Discussion
Help with creating a complex measure
- 6 years ago
Anonymous
Try this
Avg fixed cost = var _count= COUNTROWS(FILTER(ALL('Table'),'Table'[Equipment]=SELECTEDVALUE('Table'[Equipment]))) var _fixedcost= SELECTEDVALUE('Table'[Fixed Cost.Fix Cost]) var _result= DIVIDE(_fixedcost,_count,BLANK()) return _result
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
Anonymous
As per your example, the logic is the fixed cost of equipment divided by the count of equipment.
Try this
Avg fixed cost =
var _count= COUNT('Table'[Equipment])
var _fixedcost= SELECTEDVALUE('Table'[Fixed Cost.Fix Cost])
var _result= DIVIDE(_fixedcost,_count,BLANK())
return _result
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
hi nandukrishnavs & Greg_Deckler thanks for replying,
The solution nandukrishnavs has given worked at the selected or filtered level.
But what I actually want is, the count for coresponding equipment in the entire data set to remain constant.
Hence should give me constant fixed cost for individual equipment, irrespective of any filter I apply
- nandukrishnavs6 years ago
Community Champion
Anonymous
Try this
Avg fixed cost = var _count= COUNTROWS(FILTER(ALL('Table'),'Table'[Equipment]=SELECTEDVALUE('Table'[Equipment]))) var _fixedcost= SELECTEDVALUE('Table'[Fixed Cost.Fix Cost]) var _result= DIVIDE(_fixedcost,_count,BLANK()) return _result
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂- Anonymous6 years agoNot applicable
Thanks nandukrishnavs, it worked just like I wanted.
I now understood how to use FILTER command,
I will much appreciate if you can please post some informative link to understand FILTER command and its applications.
Thanks again. 🙂
- nandukrishnavs6 years ago
Community Champion
Anonymous
Refer to this: https://www.sqlbi.com/articles/filter-arguments-in-calculate/
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂