Forum Discussion
Dynamic column value when drilling up/down
- 5 years ago
Hi Bokchoy ,
This what I am thinking, create measure to use as your benchmark amount
bench measure = SELECTEDVALUE(Bench_mark[Benchmark]) * COUNTROWS('Calendar')essentially multiplies the benchmark by the number of days in each period, when drill down to the day would be 1, when looking at a month would be the number of days visible in the selected month, etc...
Then create a conditional formatting measure,
indicator value = var _val = DIVIDE(COUNTROWS('Job_orders'), [bench measure]) return SWITCH(true(), _val >= .85, "Green", _val >= .75, "Yellow", "Red" )you then create a conditional format by field value
and voila, it works at all levels.
Attached please find your pbix with the mods, Although this is not my favourite paractice I had to make the relatioship between bench_mark and job_orders bi-directional to remove the cros join when date is introduced
I hope this helps
- 5 years ago
Hi Bokchoy ,
you would modify the measures like so based on the sample
rev bench measure = SELECTEDVALUE('Table'[Benchmark_rev]) * COUNTROWS('Calendar') indicator value Rev= var _val = DIVIDE(sum(Job_orders[Sales Rev]), [dollar bench measure]) return SWITCH(true(), _val >= .85, "Green", _val >= .75, "Yellow", "Red" )results in
at period month level and
at the day level.
Richard
Hi Bokchoy ,
This what I am thinking, create measure to use as your benchmark amount
bench measure = SELECTEDVALUE(Bench_mark[Benchmark]) * COUNTROWS('Calendar')
essentially multiplies the benchmark by the number of days in each period, when drill down to the day would be 1, when looking at a month would be the number of days visible in the selected month, etc...
Then create a conditional formatting measure,
indicator value =
var _val = DIVIDE(COUNTROWS('Job_orders'), [bench measure])
return
SWITCH(true(),
_val >= .85, "Green",
_val >= .75, "Yellow",
"Red"
)
you then create a conditional format by field value
and voila, it works at all levels.
Attached please find your pbix with the mods, Although this is not my favourite paractice I had to make the relatioship between bench_mark and job_orders bi-directional to remove the cros join when date is introduced
I hope this helps
richbenmintz
Legend!