Forum Discussion
Filtered measure
- 1 year ago
hello Oros
please check if this accomodate your need.
create a new measure with following DAX.
Measure =
var _Salesperson = SELECTEDVALUE('Table'[SALESPERSON])
var _Year = SELECTEDVALUE('Table'[Year])
Return
DIVIDE(
CALCULATE(SUM('Table'[Sales]),FILTER(ALLSELECTED('Table'),'Table'[SALESPERSON]=_Salesperson&&'Table'[Year]=_Year)),
CALCULATE(SUM('Table'[Sales]),FILTER(ALL('Table'),'Table'[SALESPERSON]=_Salesperson))
)Hope this will help.
Thank you.
- 1 year ago
Hi,
PBI file attached.
Hope this helps.
Hi Ashish_Mathur ,
Thank you for your reply. Your solution works, except that it always calculates at 100% any salesperson selection. Any ideas? Thanks again.
(You solution works. ONLY when all salespersons are selected, the % becomes 100%)
(applying your solution to my context only works and shows 100% when all salespersons are selected)
BUT when only a salesperson is selected, the 100% still shows up, instead of the particular percentage for the selected salesperson. If I would select the second salesperson only, the Sales and ALL Sales columns become equal, and therefore becomes 100%. The $43,116.98 (all sales) is not showing up anymore.
Very confused about what you want. What s wrong with my solution?
- Oros1 year agoPost Prodigy
Hi Ashish_Mathur,
My bad...I overlooked at one of the table relationships. As usual, thank you so much for your kind help. 🙂
- Ashish_Mathur1 year agoSuper User
You are welcome.