The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I have a Table: People with PeopleKey, LicenceExpiryDate, NextMedicalDate and NextEyeTestDate. I need to create a Pie Chart for each of these dates depending on the status: OK, Due or Overdue based on the selected Month. If the month is Sep 2024, then I compare the validity against the last of the selected month, i.e., 30-Sep-2023. Each Pie chart should also have drill through to the corresponding people.
I tried to create a measure (and similarly for other 2 dates status)
Solved! Go to Solution.
Hi AhadKarimi,
Thanks for your reply. I had got the pie chart and measures already. But I was not able to drill through from this pie chart to another page which holds the Table for People. For examply, if I select LicenceDue in the pie chart and then drill through, I am expecting to see only those People with LicenceStatus Due. But it was showing all records.
I have come up with a work-around for this by creating separate pages for LicenceDue, LicenceOK and LIcenceOverdue with tables and filtered to the respective Licence Status. It seems to be working.
Once again, thanks for your time and support. Appreciate it.
SWR.
Regards, SWR
Hi @SWR, try this measure below, and if you encounter any issues, let me know.
Modify your LicenceStatus measure:
LicenceStatus =
VAR SelectedMonthEnd = EOMONTH(MAX('Calendar'[Date]), 0) -- Get the last day of the selected month
VAR DaysForLicenceExpiry = DATEDIFF(SelectedMonthEnd, People[LicenceExpiryDate], DAY)
RETURN
SWITCH(
TRUE(),
ISBLANK(People[LicenceExpiryDate]), "Overdue",
DaysForLicenceExpiry < 0, "Overdue",
DaysForLicenceExpiry >= 0 && DaysForLicenceExpiry <= 30, "Due",
DaysForLicenceExpiry > 30, "OK"
)
Measures for pie chart statuses:
#PeopleLicenceDue =
CALCULATE(
COUNTROWS(People),
FILTER(People, [LicenceStatus] = "Due")
)
Did I answer your question? If so, please mark my post as the solution! ✔️
Your Kudos are much appreciated! Proud to be a Solution Specialist!
Hi AhadKarimi,
Thanks for your reply. I had got the pie chart and measures already. But I was not able to drill through from this pie chart to another page which holds the Table for People. For examply, if I select LicenceDue in the pie chart and then drill through, I am expecting to see only those People with LicenceStatus Due. But it was showing all records.
I have come up with a work-around for this by creating separate pages for LicenceDue, LicenceOK and LIcenceOverdue with tables and filtered to the respective Licence Status. It seems to be working.
Once again, thanks for your time and support. Appreciate it.
SWR.
Regards, SWR
User | Count |
---|---|
14 | |
11 | |
6 | |
6 | |
5 |
User | Count |
---|---|
28 | |
17 | |
12 | |
7 | |
5 |