I'm stuck at same problem. In my case I'm using a pie chart, with a drill-down (let's say: A->B) dimension. If A gets down to just one possible value (due to other dimensions filtering), pie char automatically drills down to B but it seems there's no way to programmatically know that the currently showed dimension is B.
Paulo , currently the getcurrentfield() isn't valid in Sense .
Would you be interested in a potential workaround ?
Its a little klugy instead of using getcurrentfield() i'm using a count(distinct total) to check how many field values are within my selection.
Say you have Country->City->Customer drill path and at the top level (when viewing countries) you want the pie to count the number of cities. When a user drills on one country and narrows the selection to just one country to see the cities within that country, then they want the measure to count the customers in each city.
Here is a conditional expression (think of it as long form version of getcurrentfield() ) to figure out which level of the hierarchy you are in.
In this example, the lowest level (customer) also shows the number of customers which doesn't make much sense but ... its just a quick example, you could add a nested IF to count ( distinct total city) = 1 and then display sum(SAles) or another metric at the lowest level.
Would this work for you ?
if (count( distinct total Country) > 1, Count(distinct City) , if ( count( distinct Country)=1 , Count(distinct Customer)))
Any update on this matter? I could really use the currently applicable dimension within a drill-down for two different expressions. Both a custom calculated maximum range, and coloring based on an AGGR function.