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
tknoob_am
Regular Visitor

Need to get Percentage of Tasks based on Value of Column

Hi,

 

I'm trying to use a matrix visual to display two columns of data and the 3rd column would be the percentage of the two. 

Here's my table named Tasks:

 

TaskIDAuthorIDCompletedByIDCompletedByDateIsAssignedToAuthor
10015452023-02-03true
100210502023-02-03true
100314452023-02-03false
10046402023-02-04true
100510502023-02-04true
100614502023-02-05true
100722452023-02-05false
10085402023-02-05true
100913502023-02-06true
101021452023-02-06false
101122502023-02-06false
101223452023-02-06false
101314402023-02-07true
101413402023-02-07false
101510452023-02-07false

 

I created a meaure off the IsAssignedToUser column named CountNonAssignedUserTask.  Here is the code:

 

 

CountNonAssignedUserTask = 
CALCULATE(
	COUNTA(Tasks[TaskID]),
	Tasks[IsAssignedToAuthor]
		IN { FALSE }
)

 

 

 

I'd like the matrix to look like the following:

tknoob_am_0-1678228985910.png

 

The matrix is linked to a date slicer, so the values would change based on a date range.

 

For the matrix visual, I have "Completed By" in the Rows section and under Values, I have "Total Tasks" is a count of the TaskID column, and "Tasks for NonAssigned Users" is a count of the IsAssignedToAuthor column.

 

I'm a DAX novice.  I've searched for various approaches and tried numerous examples but cannot get the result I need for the percent column.

 

Could you please direct me to the best approach to solve my problem.

 

Thanks.

2 ACCEPTED SOLUTIONS
ahmadibrahimbus
Resolver III
Resolver III

Dear @tknoob_am ,

 

below is a sample file of power bi.

https://drive.google.com/file/d/12bf3TdPMPm2gP-O_yTuJoGmRaaW2VEJ0/view?usp=sharing

please let me know if that what you want.

View solution in original post

Ahmedx
Super User
Super User

see attached
https://1drv.ms/u/s!AiUZ0Ws7G26RhiND7H7ciTqCzeWM?e=eNJpnq

 

Total Task = 
       COUNTROWS('Table')

CountNonAssignedUserTask = 
      CALCULATE([Total Task],'Table'[IsAssignedToAuthor]=FALSE)

Percent Completed for NonAssigned Users = 
      DIVIDE([CountNonAssignedUserTask],[Total Task])

 

Screen Capture #438.png

View solution in original post

3 REPLIES 3
tknoob_am
Regular Visitor

Hi @Ahmedx and @ahmadibrahimbus,

 

Thank you for your responses.  They were very helpful.

Ahmedx
Super User
Super User

see attached
https://1drv.ms/u/s!AiUZ0Ws7G26RhiND7H7ciTqCzeWM?e=eNJpnq

 

Total Task = 
       COUNTROWS('Table')

CountNonAssignedUserTask = 
      CALCULATE([Total Task],'Table'[IsAssignedToAuthor]=FALSE)

Percent Completed for NonAssigned Users = 
      DIVIDE([CountNonAssignedUserTask],[Total Task])

 

Screen Capture #438.png

ahmadibrahimbus
Resolver III
Resolver III

Dear @tknoob_am ,

 

below is a sample file of power bi.

https://drive.google.com/file/d/12bf3TdPMPm2gP-O_yTuJoGmRaaW2VEJ0/view?usp=sharing

please let me know if that what you want.

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.