Forum Discussion
Create User Defined Bin Slicer with Parameter
- 3 years ago
Hi prattja9
With the new New Parameters menu, select Numeric Range. It works with the link you supplied. (pbix: 2 - Choose SIZE of Bins.pbix)
Let me know if you have any questions.
pbix: prattja9.pbix
- 3 years ago
Does this help? I changed to COUNTROWS( DimCustomer ) to
DISTINCTCOUNT( 'DimCustomer'[Employee ID] ) in the RETURN.Count of Customers in each Band - by size - 2 = VAR _minAge = [Min Age] VAR _maxAge = [Max Age] VAR _bandSize = [What is Band Size Value] VAR _AgeBandTable = GENERATESERIES( _minAge, _maxAge, _bandSize ) VAR _currAge = SELECTEDVALUE( 'Age Band'[Age] ) VAR _bandHead = MAXX( FILTER( _AgeBandTable, [Value] <= _currAge ), [Value] ) VAR _bandTail = _bandHead + _bandSize RETURN IF( _currAge = _bandHead, CALCULATE( DISTINCTCOUNT( 'DimCustomer'[Employee ID] ), 'Age Band'[Age] >= _bandHead && 'Age Band'[Age] < _bandTail ) )pbix: prattja9.pbix
Hi prattja9
With the new New Parameters menu, select Numeric Range. It works with the link you supplied. (pbix: 2 - Choose SIZE of Bins.pbix)
Let me know if you have any questions.
pbix: prattja9.pbix
- prattja93 years agoFrequent Visitor
Interesting, I got it to work with the sample BI report. Another question, my actual data set has multiple line items for each employee. Is there a way to modify the 15th line in the "Count of Customers in each Band - by size" measure to accomodate that complication?
- prattja93 years agoFrequent Visitor
Got it to work using CALCULATE(DISTINCTCOUNT( instead of CALCULATE(COUTROWS(.
Thanks for your help!
- grantsamborn3 years ago
Solution Sage
Sorry. I didn't see this post until I posted.
- grantsamborn3 years ago
Solution Sage
Does this help? I changed to COUNTROWS( DimCustomer ) to
DISTINCTCOUNT( 'DimCustomer'[Employee ID] ) in the RETURN.Count of Customers in each Band - by size - 2 = VAR _minAge = [Min Age] VAR _maxAge = [Max Age] VAR _bandSize = [What is Band Size Value] VAR _AgeBandTable = GENERATESERIES( _minAge, _maxAge, _bandSize ) VAR _currAge = SELECTEDVALUE( 'Age Band'[Age] ) VAR _bandHead = MAXX( FILTER( _AgeBandTable, [Value] <= _currAge ), [Value] ) VAR _bandTail = _bandHead + _bandSize RETURN IF( _currAge = _bandHead, CALCULATE( DISTINCTCOUNT( 'DimCustomer'[Employee ID] ), 'Age Band'[Age] >= _bandHead && 'Age Band'[Age] < _bandTail ) )pbix: prattja9.pbix