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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.