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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
racs
Frequent Visitor

How to write a measure to pick client specific targets in power pivot?

Hi,

 

I'm new to Excel Power Pivot & DAX and need help with following:

 

I've one lookup table with targets by each client for % of batches processed and average days taken to process a batch

 

Table 1: Target Lookup

Client NameFrequency to measure targetTarget % batches processedTarget Average days
Client 1Monthly95%3
Client 2Monthly98% 
Client 3Monthly 2
Client 4Quarterly95% 
Client 5Quarterly 3

 

This lookup table is connected to main data table by unique client name and main data table is connected to calendar lookup table using unique dates. I've already created measures for % Batches processed and Average days

I need to create a pivot table to compare Monthly or Quarterly Target vs Actual for individual clients. I need help to write a measure to get target based on client's name (selected or filtered in pivot table). 

 

Power Pivot table Output required (for one client at a time):

Client NameMonthTarget % Batches processedActual % Batches processedTarget Average daysActual Average days
Client 1Jan95%92%33.5
Client 1Feb95%97%22.5
Client 2Jan98%94% 3
Client 2Feb98%96% 2.4
Client 3Jan 95%22.5
Client 3Feb 96%22.1

 

Any help is highly appreciated.

Thank you!

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@racs Assuming that you are using the Client Name column from Table 1 in your matrix visual/pivot table, that should be simply: MAX('Table 1'[Target %])

If that is not where the Client Name column comes from then it would be something like:

MAXX(FILTER('Table 1', [Client Name] = MAX('Some other table'[Client Name]),[Target %])



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
racs
Frequent Visitor

@Greg_Deckler  Thanks a lot. The first solution worked fine. Earlier I was using MAX function, but using client name from other table to filter data in pivot, so it was not actually picking up target by client and only taking the overall  max column value from Table 1! 

 

Have a good day!

Greg_Deckler
Super User
Super User

@racs Assuming that you are using the Client Name column from Table 1 in your matrix visual/pivot table, that should be simply: MAX('Table 1'[Target %])

If that is not where the Client Name column comes from then it would be something like:

MAXX(FILTER('Table 1', [Client Name] = MAX('Some other table'[Client Name]),[Target %])



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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