Hi,
I have scenario where I have 1:* active relationship from project table to JobCard table. I have created a measure to count the number of Job Card based on selected Project where I have project slicer. The DAX for the measure is as follows:
Total Project Job Card =
var temp= CALCULATE(COUNT('jobCard'[id]),'jobCard'[project] == SELECTEDVALUE('Project'[name]))
return If(ISBLANK(temp),0,temp)
The problem Im having is when I change the project in the slicer its always showing job cards from anohter
project with 0 values for total. If I remove the condition to replace blank with 0 then it filters correctly
and when I select project with no job cards nothing shows!! why this is happening desipite the measure is filter
by selected project? How do I fix it so it shows 0 for blanks when there is job card associated with the project and show nothing when there is no association.
Solved! Go to Solution.
Please try
Total Project Job Card =
VAR temp =
CALCULATE (
COUNT ( 'jobCard'[id] ),
'jobCard'[project] == SELECTEDVALUE ( 'Project'[name] )
)
RETURN
IF ( NOT ISEMPTY ( 'jobCard' ), COALESCE ( temp, 0 ) )
Thanks. it put me on the right path.
Please try
Total Project Job Card =
VAR temp =
CALCULATE (
COUNT ( 'jobCard'[id] ),
'jobCard'[project] == SELECTEDVALUE ( 'Project'[name] )
)
RETURN
IF ( NOT ISEMPTY ( 'jobCard' ), COALESCE ( temp, 0 ) )
Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.
Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!
User | Count |
---|---|
231 | |
48 | |
47 | |
44 | |
42 |
User | Count |
---|---|
295 | |
211 | |
82 | |
72 | |
72 |