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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
TheNov3mberist
Advocate I
Advocate I

Percentage to goal by dynamic date range

Hello All, 

 

I'm having trouble with this one. Im looking to show productivity to a static goal, but i want to be able to show the overall percentage to goal (for all departments) by month or by single day depending on what the user chooses. 

 

my data looks something like this:

 

Main table:

Date                          Department        Productivity

1/1/2019 8:01AM            1                       .47

1/1/2019 8:06AM             2                      .50

1/2/2019 11:00AM          1                      .80

 

Goal table:

Department                 Goal

1                                      .9

2                                      .6

 

 

Any help would be greatly appreciated. 

1 ACCEPTED SOLUTION

@TheNov3mberist ,

 

You may try the measure below.

Measure =
AVERAGEX (
    VALUES ( 'Main'[Department] ),
    CALCULATE (
        VAR d =
            SELECTEDVALUE ( Main[Department] )
        RETURN
            DIVIDE (
                SUM ( Main[Productivity] ),
                LOOKUPVALUE ( 'Goal'[Goal], 'Goal'[Department], d )
            )
    )
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
AlB
Super User
Super User

Hi @TheNov3mberist 

 

Can you please provide an example with the expected result in both cases? What happens when a month is selected? an average of the productivity over all days in that month?

I'm sorry, yes  the average % to goal for the month for all deparments (or whichever one is selected) 

@TheNov3mberist ,

 

You may try the measure below.

Measure =
AVERAGEX (
    VALUES ( 'Main'[Department] ),
    CALCULATE (
        VAR d =
            SELECTEDVALUE ( Main[Department] )
        RETURN
            DIVIDE (
                SUM ( Main[Productivity] ),
                LOOKUPVALUE ( 'Goal'[Goal], 'Goal'[Department], d )
            )
    )
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

THANK YOU SO MUCH!! This has been driving me crazy. Again, thank you. 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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