Forum Discussion
Create a table with a variable column dependant on slicers
- 6 years ago
Hi nicolasvargas ,
Use lower bound as slicer and create measure like this:
HitRate2 = VAR min_lower_bound = SELECTEDVALUE ( 'Hit Rate Table'[Lower Bound] ) VAR max_upper_bound = SELECTEDVALUE ( 'Hit Rate Table'[Upper bound] ) VAR Hits = CALCULATE ( COUNTROWS (Database), FILTER ( Database, Database[Returns] >= min_lower_bound && Database[Returns] < max_upper_bound ) ) VAR TotalHit = COUNTROWS ( ALL ( Database ) ) RETURN IF ( ISFILTERED ( 'Hit Rate Table'[Lower Bound] ), DIVIDE ( Hits, TotalHit ), 1 )Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
nicolasvargas , I doubt you can create a table that can change with slicer value.
amitchandak so to resolve this, would you recommend to create 8 different measures each with it's own parameters?
- V-lianl-msft6 years ago
Community Support
Hi nicolasvargas ,
Use lower bound as slicer and create measure like this:
HitRate2 = VAR min_lower_bound = SELECTEDVALUE ( 'Hit Rate Table'[Lower Bound] ) VAR max_upper_bound = SELECTEDVALUE ( 'Hit Rate Table'[Upper bound] ) VAR Hits = CALCULATE ( COUNTROWS (Database), FILTER ( Database, Database[Returns] >= min_lower_bound && Database[Returns] < max_upper_bound ) ) VAR TotalHit = COUNTROWS ( ALL ( Database ) ) RETURN IF ( ISFILTERED ( 'Hit Rate Table'[Lower Bound] ), DIVIDE ( Hits, TotalHit ), 1 )Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- amitchandak6 years ago
Super User
nicolasvargas , Try the solution by V-lianl-msft
- nicolasvargas6 years ago
Helper I
V-lianl-msft amitchandak In this case the result works but only for the lower bound. The upper bound it is completely ignored in the formula. It is calculating the cummulative frequency instead of the frequency per tranche. How can we include the upper bound within the formula?
- V-lianl-msft6 years ago
Community Support
Hi nicolasvargas,
Based on your description, do you want to use both upper and lower bounds as slicers?
I'm a little confused about your scenario.
If the problem persists,could you share the sample pbix via cloud service like onedrive for business?
Please mask any sensitive data before uploading.
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.