cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TheNov3mberist Regular Visitor
Regular Visitor

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

Accepted Solutions
Community Support Team
Community Support Team

Re: Percentage to goal by dynamic date range

@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
Super User
Super User

Re: Percentage to goal by dynamic date range

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?

TheNov3mberist Regular Visitor
Regular Visitor

Re: Percentage to goal by dynamic date range

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

Community Support Team
Community Support Team

Re: Percentage to goal by dynamic date range

@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

Highlighted
TheNov3mberist Regular Visitor
Regular Visitor

Re: Percentage to goal by dynamic date range

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

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 126 members 1,377 guests
Please welcome our newest community members: