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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

Do you want to get the output below?

Capture.PNG

 

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

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

Do you want to get the output below?

Capture.PNG

 

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

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you so much! Your solution works perfectly 🙂

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.