Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hello Friends,
I have a Card Visual that is using a Measure (named: WorkItemCount) in the Fields and multiple Filters are applied.
Internally the WorkItemCount Measure using the below formula/column of the table:
WorkItemCount =
var _workitems = COUNT('Table1'[Work Item Id])
return
IF(ISBLANK(_workitem), 0, _workitem)
The above measure is being used in multiple Cards and working as expected.
Now I want to change the forecolor of the card value to Green if the displayed result (post filter) is ZERO or else RED Color for any positive numbers. For this, I have used Field Value conditional Formating and used the Color Measure.
Here is the Color Measure and formula:
Colour =
var _workitems = SELECTEDVALUE('Table1'[Work Item Id])
var _forecolor = SWITCH(
TRUE(),
_workitems = 0, "#33AE81",
_workitems > 0, "#DC5B57")
return
_forecolor
I am not able to use WorkItemCount Measure inside the Color Measure so I have used the Base Column [Work Item Id] which is used inside the WorkItemCount Measure. But this seems to work only for 0 and 1 values, but not for values that are greater than 1. Not able to find the issue or something wrong I am doing here.
Thanks,
Prabhat
Solved! Go to Solution.
Hi
Can you try below DAX. It should work as you expected.
IF (WorkItemCount = 0, "#33AE81", "#DC5B57")
Appreciate a Kudos!
If this helps and resolves the issue, please mark it as a Solution!
Regards,
N V Durga Prasad
Hi
Can you try below DAX. It should work as you expected.
IF (WorkItemCount = 0, "#33AE81", "#DC5B57")
Appreciate a Kudos!
If this helps and resolves the issue, please mark it as a Solution!
Regards,
N V Durga Prasad
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
87 | |
87 | |
84 | |
66 | |
49 |
User | Count |
---|---|
127 | |
109 | |
93 | |
70 | |
67 |