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.
Hey all,
I want to create a measure that shows dynamic target value in a card.
I am trying to implement this:
if the hours type column contains "crew" then calculate the distinct count of workdate and multiply it with 2.85 else print "please select hours type equals to crew".
My query:
cannot convert value ' the target value for the selected number of days is:' of type text to type true/false'
If I remove the text then it displays True in the card instead of displaying the target value i.e count multiplied by 2.85
Data Example:
Work Date | Hours Type | In Time | Out Time | Hours |
01/01/2019 | Direct/Training Wages | 13:54 | 15:38 | 1.73 |
01/01/2019 | Travel Time | 15:39 | 16:04 | 0.42 |
01/16/2019 | Supervisor | 07:04 | 08:20 | 1.27 |
01/16/2019 | Travel Time | 06:17 | 07:02 | 0.75 |
06/11/2019 | Crew | 09:06 | 12:06 | 3 |
06/11/2019 | Travel Time | 12:13 | 12:45 | 0.53 |
06/14/2019 | Travel Time | 06:59 | 10:55 | 3.93 |
06/14/2019 | Travel Time | 11:01 | 11:35 | 0.57 |
06/15/2019 | Supervisor | 08:58 | 11:44 | 2.77 |
06/18/2019 | Crew | 09:00 | 12:59 | 3.98 |
06/18/2019 | Travel Time | 13:01 | 13:39 | 0.63 |
06/26/2019 | Crew | 09:23 | 12:22 | 2.98 |
06/26/2019 | Travel Time | 12:30 | 13:11 | 0.68 |
Solved! Go to Solution.
Target Value = IF(CONTAINS(Employees,Employees[Hours Type],"Crew"),CALCULATE(DISTINCTCOUNT(Employees[Job Number])*2.85), "Please select hours type as Crew")
Target Value = IF(CONTAINS(Employees,Employees[Hours Type],"Crew"),CALCULATE([distinct daycount]*[distinct jobno]*2.85), "Please select hours type as Crew")
also the dates are selected by the slicer.
Target Value = IF(CONTAINS(Employees,Employees[Hours Type],"Crew"),CALCULATE(DISTINCTCOUNT(Employees[Job Number])*2.85), "Please select hours type as Crew")
Target Value = IF(CONTAINS(Employees,Employees[Hours Type],"Crew"),CALCULATE([distinct daycount]*[distinct jobno]*2.85), "Please select hours type as Crew")
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
94 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |