Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

How to create custom slicer for multiple column

Hi Everyone, 

 

I'm struggling to do the custom slicer. I hope you guys can help me. Here is the question, I have a lists of staffs with the lists of trainings courses and expiry status. What I want is that, in the power bi report I want to have:-

1. The slicer of training courses (Training A, Training B, Training C and etc. )

2. The slicer of expiry status (Not Required, Expired, <1 month, 1-2 months and >3 months)

3. Lists of name

 

So, when I click "Training A" and I click ">3 months", the lists of name will show the lists of staff who is in the Training A and the expiry is >3 months. 

 

I tried to do the unpivot column (Link#1), but it will effect my other graph that shows the general status of training completion rate. 

I also tried to do custom column (Link#2), but I can only do the Lists of Training Courses and I don't know how to link it with the Expiry Status.

Link#1: https://community.powerbi.com/t5/Desktop/Slicer-for-multiple-columns/m-p/337038#M150813

Link#2: https://community.powerbi.com/t5/Desktop/How-to-create-custom-column-for-a-slicer/td-p/551274

 

I hope you guys could help me. 

Thank you. 

 

Warm regards, 

Atiyah

 

Staff IDNameTraining ATraining BTraining CTraining DTraining ETraining F
1234567AAAANot RequiredNot RequiredNot RequiredNot RequiredNot Required1-2 months
8901234BBBB>3 months>3 months>3 months>3 months1-2 months<1 month
5678901CCCC<1 monthExpiredNot RequiredNot RequiredExpired>3 months
2345678DDD>3 months1-2 months1-2 months1-2 monthsExpired<1 month
9012345EEE>3 months1-2 months<1 month>3 months>3 months>3 months
6789012FFFExpired>3 months1-2 months>3 months<1 month>3 months
3456789GGG1-2 months>3 monthsNot Required>3 monthsNot Required>3 months
123456HHHH>3 monthsExpiredExpired<1 month>3 monthsExpired
7890123IIII>3 months<1 month1-2 months<1 month>3 months>3 months
4567890JJJJ>3 months>3 monthsNot Required>3 monthsExpired>3 months
1234456KKKK>3 monthsNot RequiredNot Required>3 months1-2 monthsExpired

3 Replies

  • Stachu's avatar
    Stachu
    Icon for Community Champion rankCommunity Champion

    I think the easiest way is to go the Unpivot route and adjust the graph with the completion rates

    how do you calculate the completion rates right now?

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Stachu, 

       

      Yes. In the interim period I'm doing it unpivot as well. 

      However, I have to upload 2 online excel into the desktop.

      1. online excel for the % completion purpose. 

      2. another online excel for custom slicer purpose. 

       

      As for the % completion, I'm using the count completion to create the graph (last column from right) on order to create the graph as picture below. 

       

      • Stachu's avatar
        Stachu
        Icon for Community Champion rankCommunity Champion

        if you calculate the completion rates in PowerBI rather than in Excel, then I think it would work fine
        consider table like this

        Staff ID Name Training Validity Status
        1234567 AAAA Training A Not Required Not Required
        1234567 AAAA Training B Not Required Not Required
        1234567 AAAA Training C Not Required Not Required
        1234567 AAAA Training D Not Required Not Required
        1234567 AAAA Training E Not Required Not Required
        1234567 AAAA Training F Valid 1-2 months
        8901234 BBBB Training A Valid >3 months
        8901234 BBBB Training B Valid >3 months
        8901234 BBBB Training C Valid >3 months
        8901234 BBBB Training D Valid >3 months
        8901234 BBBB Training E Valid 1-2 months
        8901234 BBBB Training F Valid <1 month
        5678901 CCCC Training A Valid <1 month
        5678901 CCCC Training B In Valid Expired
        5678901 CCCC Training C Not Required Not Required
        5678901 CCCC Training D Not Required Not Required
        5678901 CCCC Training E In Valid Expired
        5678901 CCCC Training F Valid >3 months
        2345678 DDD Training A Valid >3 months
        2345678 DDD Training B Valid 1-2 months
        2345678 DDD Training C Valid 1-2 months
        2345678 DDD Training D Valid 1-2 months
        2345678 DDD Training E In Valid Expired
        2345678 DDD Training F Valid <1 month

        and measures like this

        Completion = CALCULATE(COUNTROWS('Table1'),'Table1'[Validity]="Valid")
        
        Total Training Courses = CALCULATE(COUNTROWS('Table1'),'Table1'[Validity]<>"Not Required")
        
        % Completion = DIVIDE([Completion],[Total Training Courses])

        they do give the same results as Excel in the employee filter context, you may just need to play a bit more with the filters to get the right totals (I'm not sure if 14/17 is consistent with your requirements for this four)