Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Results in custom table

Hi guys,

 

I have source table in following format:

IDStart TimeEnd TimeTime BTWKPIKPI5KPI10KPI15KPI30Type
101.01.2018 07:00:0003.01.2018 18:14:122,47KPI51111G
201.01.2018 07:36:0208.01.2018 11:12:487,15KPI100111G
301.01.2018 07:24:0028.01.2018 11:29:0027,17KPI300001G
401.01.2018 07:10:5812.01.2018 10:09:0411,12KPI150011E
501.01.2018 07:12:1304.01.2018 08:59:203,07KPI51111E

 

What I need to do is create following output table:

 TeamType = G
 #%#%
KPI5240%133%
KPI10360%267%
KPI15480%3100%
KPI305100%3100%

 


Logic: If I fulfill KPI10, then I automatically fulfill also KPI5, etc.

Logic: % KPI 10 = 3 / 5, etc.

 

Is there some way how to get such result - combine these data into 1 custom table?

 

Thanks in advance

  • Hi Anonymous,

     

    Do you want to get the output below?

     

    If it is, you may do some changes for your data model in Query Editor.

     

    1. Select the columns KPI5,KPI10,KPI15,KPI30 and Click Unpivot columns.

     

    2. Change the Attribute to KPI, then Apply&& Close.

     

    3. Create the four measures with the formula below.

     

    Team = CALCULATE(COUNTROWS(Table1),FILTER(ALLEXCEPT(Table1,'Table1'[KPI]),'Table1'[Value]=1))
    
    % = DIVIDE('Table1'[Team],CALCULATE(COUNT(Table1[Value])))
    
    type_G = CALCULATE(COUNTROWS('Table1'),FILTER(ALLEXCEPT(Table1,Table1[KPI]),'Table1'[Value]=1&&'Table1'[Type]="G"))
    
    %_ = DIVIDE([type_G], CALCULATE(COUNTROWS('Table1'),FILTER('Table1','Table1'[Type]="G")))

    More details, you could have a reference of the attachment.

     

    Best  Regards,

    Cherry

2 Replies

  • v-piga-msft's avatar
    v-piga-msft
    Icon for Resident Rockstar rankResident Rockstar

    Hi Anonymous,

     

    Do you want to get the output below?

     

    If it is, you may do some changes for your data model in Query Editor.

     

    1. Select the columns KPI5,KPI10,KPI15,KPI30 and Click Unpivot columns.

     

    2. Change the Attribute to KPI, then Apply&& Close.

     

    3. Create the four measures with the formula below.

     

    Team = CALCULATE(COUNTROWS(Table1),FILTER(ALLEXCEPT(Table1,'Table1'[KPI]),'Table1'[Value]=1))
    
    % = DIVIDE('Table1'[Team],CALCULATE(COUNT(Table1[Value])))
    
    type_G = CALCULATE(COUNTROWS('Table1'),FILTER(ALLEXCEPT(Table1,Table1[KPI]),'Table1'[Value]=1&&'Table1'[Type]="G"))
    
    %_ = DIVIDE([type_G], CALCULATE(COUNTROWS('Table1'),FILTER('Table1','Table1'[Type]="G")))

    More details, you could have a reference of the attachment.

     

    Best  Regards,

    Cherry

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you so much! Your solution works perfectly :)