Forum Discussion
Calculated Values in a Chart
- 1 year ago
Unfortunately it did not, but thank you for trying. FYI, when I initially posted this, it was flagged as spam incorrectly and so I re-posted the question here: https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Dynamic-Measure-of-Distinct-Counts/m-p/4117855#M163477. The solution is working there. Someone at Microsoft un-flagged this original post.
Hi SoupyNoodles14, try two measures below, and if you encounter any issues, let me know.
Prior Service Count =
VAR CurrentVisitID = SELECTEDVALUE('Priors'[VisitID])
RETURN
CALCULATE(
COUNTROWS('Priors'),
FILTER(
'Priors',
'Priors'[VisitID] = CurrentVisitID &&
NOT(ISBLANK('Priors'[PriorServiceID])) -- Exclude blanks (NULLs)
)
)Visit Count =
CALCULATE(
COUNTROWS('Priors'),
ALLEXCEPT('Priors', 'Priors'[VisitID]) -- Ensures grouping by VisitID
)
Did I answer your question? If so, please mark my post as the solution!✔️
Your Kudos are much appreciated! Proud to be a Responsive Resident!
Unfortunately ahadkarimi what's happening with this is that PowerBI is not showing anything for the first measure you've suggested "Prior Service Count" and the second measure "Visit Count" is not returning a meaningful value. "Visit Count" is returning a number that is neither the total number of visits nor prior services and "Prior Service Count" is listing blank.