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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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