Forum Discussion
PowerBI dynamic columns based on slicer
- 2 years ago
Hi abiyevnijat ,
For this you need to use a different measure. Try the following measure:
Business Time % = VAR temptable = ADDCOLUMNS ( 'Dashboard', "@BusinessTime%", IF ( 'Dashboard'[Business] < SELECTEDVALUE ( 'Slicer'[Slicer] ), 1, SELECTEDVALUE ( Slicer[Slicer] ) / 'Dashboard'[Business] ) ) RETURN AVERAGEX ( temptable, [@BusinessTime%] )See PBIX file attach.
Hi abiyevnijat ,
You need to create a new measure to use on your visualizations, you cannot update values on a table using a slicer.
So in this case the Business Time % needs to be a measure also and not a calculated column on your model, that way you get the expected result that is dynamic based on the what if parameter measure.
- abiyevnijat2 years agoFrequent Visitor
Thanks again for your response. I created parameter which values between 1 from 48. Then I create measure
Business Time % = IF ( 'Dashboard'[Business] < SELECTEDVALUE('Slicer'[Value]), 1, SELECTEDVALUE('Slicer'[Value]) / 'Dashboard'[Business] )In this measure my Business values is a column in my Dashboard table and I cant result Business Time % like that. Is there any method to find Business Time %, with different code or something which I can show average Business Time % in card visual, when I change my values in slicer when add parameter
- MFelix2 years ago
Super User
Hi abiyevnijat ,
For this you need to use a different measure. Try the following measure:
Business Time % = VAR temptable = ADDCOLUMNS ( 'Dashboard', "@BusinessTime%", IF ( 'Dashboard'[Business] < SELECTEDVALUE ( 'Slicer'[Slicer] ), 1, SELECTEDVALUE ( Slicer[Slicer] ) / 'Dashboard'[Business] ) ) RETURN AVERAGEX ( temptable, [@BusinessTime%] )See PBIX file attach.
- abiyevnijat2 years agoFrequent Visitor
It is completely what I want. Big thanks for you