Forum Discussion

abiyevnijat's avatar
abiyevnijat
Frequent Visitor
2 years ago
Solved

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...
  • MFelix's avatar
    MFelix
    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.