Forum

Target Achievement
 
Notifications
Clear all

Target Achievement

8 Posts
3 Users
0 Reactions
52 Views
(@jhowell4)
Posts: 10
Active Member
Topic starter
 

I have two sets of data

Training targets (list of courses and the number of seats per fiscal year)

Training Achievement (list of students that completed a course and which fiscal year it was)

I want to display the achievement as a % of the target in a pivot table and then use slicers to drill down.

I've put togther the attached example which only displays the correct % when I'm drilled down to the lowest level.  I've obviously not doing the calculation the right way but I'm sort of lost at this point.  Where am I going wrong?

 
Posted : 07/12/2019 12:08 am
(@mynda)
Posts: 4761
Member Admin
 

Hi John

You need to do this in a DAX measure so that it can recalculate at the row level context based on the filtered position of the Slicers. If you do it in Power Query then you fix the level of granularity, which is why you're having problems.

In the attached file you'll see I've written a measure to do the calculation. Also take notice of the tables that the row and column fields came from in the PivotTable, as they are not the fact tables. 

It looks like you haven't started the Power Pivot course yet, so I recommend you do that before moving forward with your own Power Pivot models.

Mynda

P.S. I've moved this thread to the Power Pivot thread.

 
Posted : 07/12/2019 2:52 am
(@jhowell4)
Posts: 10
Active Member
Topic starter
 

Hi Mynda, Thanks for the response. I can't seem to download your attachment? 

 
Posted : 09/12/2019 7:42 pm
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi John,

I've reattached the file, please try again.

Phil

 
Posted : 09/12/2019 8:11 pm
(@jhowell4)
Posts: 10
Active Member
Topic starter
 

Hi Phil, Thanks, got it now.

 
Posted : 09/12/2019 8:18 pm
(@jhowell4)
Posts: 10
Active Member
Topic starter
 

john_pp_dax_measure_error.PNGWhen I open the example file there is an error with the measure saying that COUNT can't work with a string?

 
Posted : 09/12/2019 8:30 pm
(@mynda)
Posts: 4761
Member Admin
 

Hi John,

I don't get that error, but you can just edit the measure and change the function from COUNT to COUNTA.

Mynda

 
Posted : 09/12/2019 9:06 pm
(@jhowell4)
Posts: 10
Active Member
Topic starter
 

Thanks Mynda,  I worked this into my real data and it works perfectly.

 
Posted : 10/12/2019 8:43 pm
Share: