Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

View all the Fabric Data Days sessions on demand. View schedule

Reply
Nabil20_24
Helper I
Helper I

Drill through using inactive relationship

I have a client dataset structured as follows

Client NameStatusActive DateInactive Date
AlexActive05/02/2024 
BellaInactive18/06/202312/01/2024
ChrisActive22/09/2022 
DianaBlank14/03/2024 
EthanInactive09/07/202123/12/2023
FionaActive01/11/2023 
GeorgeInactive27/04/202205/09/2024
HannahBlank30/08/2024 
IanActive16/05/2023 
JuliaInactive11/12/202319/02/2024
KevinActive02/07/2024 
LauraBlank10/10/2024 
MichaelInactive03/09/202115/11/2023
NatalieActive20/04/2023 
OliverInactive29/05/202008/03/2023

 

I connected this table to a date table, establishing an active relationship between the date column in the date table and the active date column in the client table. Additionally, I set up an inactive relationship between the date table and the inactive date column in the client table.

Now, I want to create a bar chart in Power BI to visualise the number of active versus inactive clients per month over time in my main sheet.

Drillthrough Setup:

  • I have a drillthrough sheet that contains a table identical to my dataset.

  • The goal is:

    • When I drill through from active clients, I should see details of all active clients.

    • When I drill through from inactive clients, I should see details of all inactive clients.

      Approach Taken:

      1. I created a calculated column called Drillthrough, setting it to 1.

      2. I then created a measure to count the number of 1s when the inactive relationship is active:

        DAX
        CopyEdit
        DrillthroughControl = CALCULATE(SUM(ClientTable[Drillthrough]), USERELATIONSHIP(ClientTable[Inactive Date], DateTable[Date]))
      3. In my bar chart:

        • I dragged Client Name to the Y-axis and applied a distinct count to avoid counting duplicates.

        • I added Status to the legend.

        • In the filter pane, I placed DrillthroughControl and set it to be greater than 0.

      4. In my drillthrough table:

        • I added Client Name and Status to the drillthrough filters pane.

        • I added DrillthroughControl to the table filters pane, setting it to be greater than or equal to 1.

      Issue:

      • When I drill through from Active clients, I do not get the expected results.

      • When I drill through from Inactive clients, I also do not get the correct values.

      Request:

      Could someone help me troubleshoot this issue or suggest an alternative approach to achieve the correct drillthrough functionality?

13 REPLIES 13
v-sdhruv
Community Support
Community Support

Hi @Nabil20_24 ,
Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution ' so other members can easily find it.
Please feel free to contact us if you have any further questions.
Thank you

v-sdhruv
Community Support
Community Support

Hi @Nabil20_24 ,
Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Please feel free to contact us if you have any further questions.
Thank you

v-sdhruv
Community Support
Community Support

Hi @Nabil20_24 ,
Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Please feel free to contact us if you have any further questions.
Thank you

v-sdhruv
Community Support
Community Support

Hi @Nabil20_24 ,
Just wanted to check if you had the opportunity to implement the solutions provided by the users? 
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.

Hi, thanks a lot for your time and help! The solution provided doesn’t quite get the output I need.

 

I want to create a bar chart that shows the number of active and inactive clients side by side. I also want to have one drill-through page that contains the underlying data.

So, when I right-click on the active bar in the chart (to drill through), I want to see all the active clients in detail, including their name, location, join date, etc. Similarly, when I click on the inactive bar, I want to go to the same drill-through sheet and see all the inactive clients without having to create separate drill-through pages or data tables for each client status (active and inactive).

Hi @Nabil20_24 ,
The chart shows active/ inactive users side by side.
If you right click on the bar you would be directed to a table that will show the details of that particular bar.
Below snap for reference-

Shruti_D_1-1744802311173.pngShruti_D_2-1744802327848.png

If you need some help on how to implement drill through feature, you can refer this link
https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-drillthrough

Hope this helps!
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.

v-csrikanth
Community Support
Community Support

Hi @Nabil20_24 

You can perform following transformations to achieve this result.

  1. Unpivot Active Date and Inactive Date
    vcsrikanth_0-1743507198051.jpeg
  2. Extract Active/Inactive text from Attribute column to create another status column
    vcsrikanth_1-1743507229031.jpeg

     

  3. Add a flag that would filter out the duplicate records. 
        Specifically, those who are inactive but have active date. So, we remove them and categorize it as inactive.

    Use custom column to create flag column

    vcsrikanth_2-1743507284532.jpeg

    Finally, filter out 0s and keep 1s to load the data.
    5. Pull 
    Month from Date – X-axis
    Count Client – Y axis

    Status2 – Legend
    Use slicer – Year (from date table), Month(From date table)
    Modelling-
    Active date--------Date[Date]
    Then you will get the desired result.
    For 2023

    vcsrikanth_3-1743507305735.jpeg

     

    For 2022

    vcsrikanth_4-1743507305736.jpeg

    Hope this helps!

    Attached file for your reference.

danextian
Super User
Super User

Hi @Nabil20_24 

 

I'm not entirely sure what you're trying to achieve since you haven't provided the expected result, just descriptions based on the sample data. However, for active clients, shouldn't the date range be from the start of their activity until just before inactivity, rather than only the active date? As for inactive clients, do you want to count them only in the month they became inactive or continue counting them from that point onward?

danextian_0-1743154045893.png

 

You might find the attached pbix useful.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

You're right! I should have included the expected output. To count the number of active clients, we need to count the number of client names where the status is 'Active'. To count inactive clients, we need to count the number of client names where the inactive date is not blank.

For example, if I have the dataset below and select the year 2022 from the slicer, the bar chart should show 2 active clients in January 2022 and 0 inactive clients. If I select 2023 from the slicer, In Jan it should show 3 inactive clients and 1 active client

Client NameStatus   Active Date     Inactive Date
OliverInactive   01/01/2022     08/01/2023
EthanInactive   02/01/2022     23/1/2023
MichaelInactive    03/01/2022     15/1/2023
GeorgeInactive   04/01/2022    05/09/2024
ChrisActive   01/01/2022 
NatalieActive   02/01/2022 
IanActive   03/01/2023 
v-csrikanth
Community Support
Community Support

Hi @Nabil20_24
You can try this method where you don't have to create any DAX measure for your drill-through page-

Step 1: Modelling-

Establish an active relationship between date from Date table to Active Date from Client Table.

vcsrikanth_3-1743151033584.jpeg

Step 2: Visualization

1. Use Status field on x-axis.
2. Count distinct Client name on y-axis
3. Status as Legend
4. You can use Year and month as slicer to filter for any specific year or month

vcsrikanth_4-1743151052635.jpeg

Step 3: Set drill-through page

1. Use status as a drill-through filter.
2. Add a table with fields like Client name, Status, Active date. Inactive date.

vcsrikanth_5-1743151067972.jpeg

 

If you need more information on how drill-through works, you can visit

https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-drillthrough

Hope this helps!

If the above information helps you, please give us a Kudos and marked the Accept as a solution.
Best Regards,
Community Support Team _ C Srikanth.

That's brilliant, thanks a lot! However, I want to create a bar chart where the months are on the X-axis, and the number of active and inactive clients are displayed side by side. Also, to find inactive clients I need to use inactive date hence why I also need another relationship between date and inactive date 🙂 


Hi @Nabil20_24 
You can have Month from date hierarchy on x-axis and drill through active/inactive users.
Make sure drill through page has Month as its drill through field.

 

vcsrikanth_0-1743159361283.jpeg



If the above information helps you, please give us a Kudos and marked the Accept as a solution.
Best Regards,
Community Support Team _ C Srikanth.

Thnak you; to count the number of inactive clients we need to use the inactive date; the data model you provided me with has active relationship between date from Date table to Active Date from Client Table only so it wont show me the results I want.

For example, if I have the dataset below and select the year 2022 from the slicer, the bar chart should show 2 active clients in January 2022 and 0 inactive clients. If I select 2023 from the slicer, In Jan it should show 3 inactive clients and 1 active client

Client NameStatus   Active Date     Inactive Date
OliverInactive   01/01/2022     08/01/2023
EthanInactive   02/01/2022     23/1/2023
MichaelInactive    03/01/2022     15/1/2023
GeorgeInactive   04/01/2022    05/09/2024
ChrisActive   01/01/2022 
NatalieActive   02/01/2022 
IanActive   03/01/2023 




Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors