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

Show dynamic target value in card

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:

Measure Card KPI = "The target value for the selected number of days is: "
&&
IF(CONTAINS(Employees,Employees[Hours Type],"Crew"),CALCULATE(DISTINCTCOUNT(Employees[Work Date].[Date])*2.85),"Please select Hours Type as crew")
 
Error:

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 DateHours TypeIn TimeOut TimeHours
01/01/2019Direct/Training Wages13:5415:381.73
01/01/2019Travel Time15:3916:040.42
01/16/2019Supervisor07:0408:201.27
01/16/2019Travel Time06:1707:020.75
06/11/2019Crew09:0612:063
06/11/2019Travel Time12:1312:450.53
06/14/2019Travel Time06:5910:553.93
06/14/2019Travel Time11:0111:350.57
06/15/2019Supervisor08:5811:442.77
06/18/2019Crew09:0012:593.98
06/18/2019Travel Time13:0113:390.63
06/26/2019Crew09:2312:222.98
06/26/2019Travel Time12:3013:110.68
2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Target Value = IF(CONTAINS(Employees,Employees[Hours Type],"Crew"),CALCULATE(DISTINCTCOUNT(Employees[Job Number])*2.85), "Please select hours type as Crew")

View solution in original post

Anonymous
Not applicable

Target Value = IF(CONTAINS(Employees,Employees[Hours Type],"Crew"),CALCULATE([distinct daycount]*[distinct jobno]*2.85), "Please select hours type as Crew")

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

also the dates are selected by the slicer.

Anonymous
Not applicable

Target Value = IF(CONTAINS(Employees,Employees[Hours Type],"Crew"),CALCULATE(DISTINCTCOUNT(Employees[Job Number])*2.85), "Please select hours type as Crew")

Anonymous
Not applicable

Target Value = IF(CONTAINS(Employees,Employees[Hours Type],"Crew"),CALCULATE([distinct daycount]*[distinct jobno]*2.85), "Please select hours type as Crew")

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.