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
Tor
New Member

Help with multiple entries from users and unique values

Hello. 

I have a problem with a new database and would like a helping hand. 

 

Database: To summarize, my database consists on a list of Action plans, activities and advance towards completing this activities. 

  • An action plan is created and this contains multiple activities that must be completed. 
  • Activities must be completed by anyone from a large group of people before specific date. 
  • Each time anyone reports an "advance" a new entry to the list is added until activity is completed and eventually, until action plan is completed. 

Problem:

  • Action plans have a unique code, but activities dont have an unique code.
  • I must count activities on due for each person, but since i have an entry for each activity advance, i count due activities multiple times. 

 

Database example:

Action plan codeAction plan nameAction plan responsibleActivityActivity responsibleActivity due dateActivity advanceActivity status 
1AP1PeterActivity 1Tony11-feb-23nullOpen 
1AP1MaryActivity 2Jess20-feb-23Advance 1Open 
1AP1MaryActivity 2Jess20-Feb-23Advance 2Open 

 

I think, i may need to create a unique code to identify activities, but unsure how to do this on M in Power Query, or in DAX. 

 

Any help would be appretiated. 

 

Tor

1 ACCEPTED SOLUTION
edhans
Super User
Super User

Not 100% sure I understand the ask. But, if you add the person responsible to a visual in Power BI, then create a measure as follows:

Activity Count = DISTINCTCOUNT(TableName[Activity])

That will give you a distinct count of the activities for that user. So Mary will have 1 since she has "Activity 2" twice. 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

3 REPLIES 3
edhans
Super User
Super User

Not 100% sure I understand the ask. But, if you add the person responsible to a visual in Power BI, then create a measure as follows:

Activity Count = DISTINCTCOUNT(TableName[Activity])

That will give you a distinct count of the activities for that user. So Mary will have 1 since she has "Activity 2" twice. 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Thank you for your response!

 

This actially worked perfectly. 

 

I was looking for an extra column while transforming data and did not think of a measure as suggested. 

 

This allowed to me to count the total number of activities that Mary is pending to complete.

 

Thank you for your time! 

Glad I was able to help @Tor . 
I always look for a measure first as it adds no data to the model, so is the most efficient way to report info back to the user.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

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
Top Kudoed Authors