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
I have the following table:
This table is basically capturing whether a job is finished or not. I am displaying the job vs date graph below:
In this graph, I would like to display a tooltip such that:
- It should display a distinct count of the finishNumber column based on whether the task is complete or not complete.
For instance, on 3/1/2017, I have 2 completed tasks and one uncompleted task. The uncompleted tasks do not have finishNumber. So, in my bar graph, when I hover over the red area, the distinct count of finishNumber for the two completed tasks should be 2 ( since 14 and 16 are distinct). And if i hover over the black area, the distinct count should be zero (since there is no finishNumber for the very first record).
How can I accomplish this? I am not sure what logic to implement and whether it should be a measure or a column?
Would appreciate any help.
Solved! Go to Solution.
Distinct Count Measure = CALCULATE ( DISTINCTCOUNT ( 'Table'[finishNumber] ), FILTER ( 'Table', 'Table'[finishNumber] <> BLANK () ) ) + 0
Add plus zero - it just forces the zero to show!
This is what I would do...
Create this Measure (you can rename it something better)
Distinct Count Measure =
CALCULATE (
DISTINCTCOUNT ( 'Table'[finishNumber] ),
FILTER ( 'Table', 'Table'[finishNumber] <> BLANK () )
)
And then setup your Chart like in the picture below
Date on Axis, AppID in the Legend, Measure in the Value
(right-click on AppID in the Legend as check - Show Items with No Data)
Hope this helps!
Since he already have IsFinished flag, no need to calculate a measure assuming each job will have one record:
- Put date on the axi
- IsFinished on legent
- Cound Job Id on value
and it will do the job, no?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Use my Measure from above in the Tooltips!
It will show up only for true!
Distinct Count Measure = CALCULATE ( DISTINCTCOUNT ( 'Table'[finishNumber] ), FILTER ( 'Table', 'Table'[finishNumber] <> BLANK () ) ) + 0
Add plus zero - it just forces the zero to show!
@sieed what I mentioned will work, make sure you have IsFinished on Legend. No sure why there is a need to calculate a measure when you already have IsFinished to seperate between finished and non-finished jobs. Also it is assuming that you will unique finish number. It is always good to provide little context about the dataset so that better solution can be provided.
THanks,
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2kWhat do you propose we drag to the tooltips? And how will you make it show zero on False?
And BTW my measure would work with COUNTA not only DISTINCTCOUNT because EACH Column represents an APP
However here's why I used DISTINCTCOUNT - this is from the original question...
"the distinct count of finishNumber for the two completed tasks should be 2 ( since 14 and 16 are distinct)"
@parry2k, I am trying to find the ditinct count of "finishNumber" based on whether a task is completed or not for that particular date.
For instance, on 3/12017, I have three tasks, two of which are complete. Moreover, these two completed tasks have different "finishNumber". so, the distinct count should be 2 on the tool tip. Also, for the same bar on the same date, the black area (the area representing the record which is not complete) should show distinct count of zero since there is no "FinishNumber" for that record.
@Sean, the legend is the "IsFinished" column, not the AppID. That's the chellenging part.
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 |
---|---|
94 | |
92 | |
82 | |
71 | |
49 |
User | Count |
---|---|
143 | |
121 | |
112 | |
58 | |
57 |