cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Shlok_M_Shah Helper I
Helper I

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

Accepted Solutions
Shlok_M_Shah Helper I
Helper I

Re: Show dynamic target value in card

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

Shlok_M_Shah Helper I
Helper I

Re: Show dynamic target value in card

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
Shlok_M_Shah Helper I
Helper I

Re: Show dynamic target value in card

also the dates are selected by the slicer.

Shlok_M_Shah Helper I
Helper I

Re: Show dynamic target value in card

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

Shlok_M_Shah Helper I
Helper I

Re: Show dynamic target value in card

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

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Top Solution Authors
Top Kudoed Authors