Forum Discussion
abiyevnijat
2 years agoFrequent Visitor
PowerBI dynamic columns based on slicer
Hello everyone, Business Time % = IF ( 'Dashboard'[Business] < [SLA Time], 1, [SLA Time] / 'Dashboard'[Business] ) I have calculated column in my main table (Dashboard). My SLA Time measure...
- 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.
abiyevnijat
2 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
MFelix
Super User
2 years agoHi 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