Forum Discussion
Calculations with virtual table
- Anonymous1 year ago
Thanks for the reply from lbendlin and Greg_Deckler, please allow me to provide another insight.
Hi cursty ,
Please try the following dax.Perc_Rank = VAR _tb = CALCULATETABLE(SUMMARIZECOLUMNS('Expenses'[item_id],"Expense",[Expenses]),ALL()) VAR _expenses = VALUE([Expenses]) VAR _lower = IF(COUNTROWS(FILTER(_tb, [Expense]<_expenses))=BLANK(),0,COUNTROWS(FILTER(_tb, [Expense]<_expenses))) VAR _higher = IF(COUNTROWS(FILTER(_tb, [Expense]>_expenses))=BLANK(),0,COUNTROWS(FILTER(_tb, [Expense]>_expenses))) RETURN DIVIDE(_lower,_higher+_lower,0)
The result is as follows, hopefully it will meet your needs.
Please see the attached pbix for reference.
Best Regards,
Dengliang Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
lbendlin cursty Yes I did actually. I created a DAX equivalent Quick Measure for it.
Thank you for suggestion Greg_Deckler lbendlin
I used your measure in my dashboard, but unfortunately it still doesn't resolve my problem as I'm receiving value 0 for the item with highest expenses and blanks for the rest of them.
Below, I highlighted what I've changed in your original code