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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

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