Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply
abiyevnijat
Frequent Visitor

PowerBI dynamic columns based on slicer. NEED HELP!!!

Hello everyone,

I have calculated column in my main table (Dashboard) like that:
Business Time % = IF ( 'Dashboard'[Business] < [SLA Time], 1, [SLA Time] / 'Dashboard'[Business] )

then created measure like that:
AVG Business Time % = AVERAGE('Dashboard'[Business Time %])

Format of Business column is decimal number and it represent hour of completed tasks. Every row of column is different from 0 to 100.
My SLA Time measure is SLA Time = 2
which is not dynamic and I am changing manually. I want to create slicer dropdown visual which values changing from 1 to 48 instead of SLA Time. When I select my wanted value from slicer I want to get result AVG of Business Time % dynamically.

I got this result manually, but I want to share this in web. That is why want to get result dynamically for users.

question.png

1 ACCEPTED SOLUTION
abiyevnijat
Frequent Visitor

Business Time % =
VAR temptable =
    ADDCOLUMNS (
        'Dashboard',
        "@BusinessTime%",
            IF (
                'Dashboard'[Business] < SELECTEDVALUE ( 'Slicer'[Slicer] ),
                1,
                SELECTEDVALUE ( Slicer[Slicer] ) / 'Dashboard'[Business]
            )
    )
RETURN
    AVERAGEX ( temptable, [@BusinessTime%] )

This is final solution of my task.

View solution in original post

2 REPLIES 2
abiyevnijat
Frequent Visitor

Business Time % =
VAR temptable =
    ADDCOLUMNS (
        'Dashboard',
        "@BusinessTime%",
            IF (
                'Dashboard'[Business] < SELECTEDVALUE ( 'Slicer'[Slicer] ),
                1,
                SELECTEDVALUE ( Slicer[Slicer] ) / 'Dashboard'[Business]
            )
    )
RETURN
    AVERAGEX ( temptable, [@BusinessTime%] )

This is final solution of my task.

Idrissshatila
Super User
Super User

Hello @abiyevnijat ,

 

check this https://youtu.be/6a_5uderwAg?si=WgU4Leb3uEVHPRD2

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin
Vote for my Community Mobile App Idea 💡



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.