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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Count of latest entry

Having some problems getting my visualisation to show what I want it to show... Hopefully someone out there can help me out.

 

The story is:   A team with 5 account managers taking care of a number of projects for the company.

The teamleader wants a realtime updated report showing exact number of projects currently owned by each account manager... Rather simple... Just do a COUNT of projects for each account manager.

But sometimes more than one account managerhas been looking at a project, and the "ownership" of each project should only be counted towards the account manager that has last updated the project.

 

Might be easier if I show you how it looks....

The datatable looks more or less like this:

Account ManagerProjectLast Updated
AM 01ABC1234-12 2019
AM 02DEF4565-12 2019
AM 03GHI7896-12 2019
AM 02ABC1237-12 2019
AM 05JKL0128-12 2019
AM 01OPQ34510-12 2019
AM 04RST67811-12 2019
AM 02OPQ34513-12 2019
AM 05UVW90114-12 2019
AM 01XYZ23415-12 2019
AM 05GHI78920-12 2019
AM 03OPQ34523-12 2019
AM 04JKL01227-12 2019
AM 02DEF45628-12 2019

 

What the visualisation is showing me right now is:

Account ManagerTotal projectsDistinct projects
AM 0133
AM 0243
AM 0322
AM 0422
AM 0533
TOTAL1413

 

But what I want it to show me would be something like this:

Account ManagerCurrent projects
AM 011
AM 022
AM 031
AM 042
AM 052
TOTAL8

 

I have searched for several days and the only possible sollutions to this would be some sort of variable DAX code to ensure that only the most recent procejt is counted... But when I try all the different codes I have found in the forum I get the same error message saying that the particular DAX code can't be used in Direct Query mode.

1 ACCEPTED SOLUTION

Hi,

This measure works

Current projects = COUNTROWS(FILTER(SUMMARIZE(VALUES(Data[Project]),Data[Project],"Last update by the manager",MAX(Data[Last Updated]),"Last update by any manager",CALCULATE(MAX(Data[Last Updated]),ALL(Data[Account Manager]))),[Last update by the manager]=[Last update by any manager]))

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

In the last Table, please show the the projects in each rows as well.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi.

Not really sure what you mean, but the account manager that has ownership of each of the projects is the account manager that last updated the project.

And what i'm aiming to do is simply to make a table that looks like the last table I showed above...

A line for each of the account managers with the exact number of owned projects right now.

 

Current projectsOwnerLast updated
ABC123AM 027-12 2019
DEF456AM 0228-12 2019
GHI789AM 0520-12 2019
JKL012AM 0427-12 2019
OPQ345AM 0323-12 2019
RST678AM 0411-12 2019
UVW901AM 0514-12 2019
XYZ234AM 0115-12 2019

Hi,

This measure works

Current projects = COUNTROWS(FILTER(SUMMARIZE(VALUES(Data[Project]),Data[Project],"Last update by the manager",MAX(Data[Last Updated]),"Last update by any manager",CALCULATE(MAX(Data[Last Updated]),ALL(Data[Account Manager]))),[Last update by the manager]=[Last update by any manager]))

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thanks.

Needed to do some tweaking to the code, but it appears to work like it should.

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors