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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
nor303
Helper III
Helper III

How to group, make calculations and then ungroup, possible?

Im trying to make calculations on a group level and then ungroup. Its a little hard to explain so I have made an example in Excel on how I want it done. Im thinking about doing it in a query since I have a folder of excel files which I update quarterly. However if its better to make some new columns or a measure thats also ok, as long as I get it right:) Thanks!

 

Input         
CustomerIDLoanOther loansValueCollateralLTVLTV Intervall 
A1111012092 %75-100%  
A1315227063 %50-75%  
A158120143 %25-50%  
B21518075 %75-100%  
B2325055542 %25-50%  
C3310218163 %50-75%  
D417025028 %25-50%  
D4320537068 %50-75%  
D455460150 %Above 100% 
D47140121108 %Above 100% 
          
          
Step 1         
CustomerIDLoanOther loansValueCollateralLTVLTV IntervallLTV GroupLTV Intervall Group
A 343591  62 %50-75%
B 301635  46 %25-50%
C 102181  63 %50-75%
D 469801  68 %50-75%
          
          
          
Step 2         
CustomerIDLoanOther loansValueCollateralLTVLTV IntervallLTV GroupLTV Intervall Group
A1111012092 %75-100%62 %50-75%
A1315227063 %50-75%  
A158120143 %25-50%  
B21518075 %75-100%46 %25-50%
B2325055542 %25-50%  
C3310218163 %50-75%63 %50-75%
D417025028 %25-50%68 %50-75%
D4320537068 %50-75%  
D455460150 %Above 100% 
D47140121108 %Above 100% 
2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @nor303 ,

Here some steps that I want to share, you can check them if they suitable for your requirement.

Here is my test data:

vheqmsft_0-1706668233201.png

Create two measures

 

LTV Group = 
CALCULATE(
    DIVIDE(SUM('Table'[Loan])+SUM('Table'[Other loans]),SUM('Table'[Value])+SUM('Table'[Collateral])),
    ALLEXCEPT('Table','Table'[Customer])
)
LTV Intervall Group = 
SWITCH(
    TRUE(),
    [LTV Group]<=0.25,"0-25%",
    [LTV Group]>0.25&&[LTV Group]<=0.5,"25-50%",
    [LTV Group]>0.5&&[LTV Group]<=0.75,"50-75%",
    [LTV Group]>0.75&&[LTV Group]<=1,"75-100%",
    [LTV Group]>1,"Above 100%"
)

 

Final output

vheqmsft_1-1706668467797.png

 

Best regards

Albert He

 

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

Anonymous
Not applicable

Hi @nor303 ,
You can test this by following the steps in my pbix file. If my answer is correct, please mark it as accept as solution.

Best regards

Albert He

 

If this post helps, then please consider Accept it as the solutionton help the other members find it more quickly

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @nor303 ,

Here some steps that I want to share, you can check them if they suitable for your requirement.

Here is my test data:

vheqmsft_0-1706668233201.png

Create two measures

 

LTV Group = 
CALCULATE(
    DIVIDE(SUM('Table'[Loan])+SUM('Table'[Other loans]),SUM('Table'[Value])+SUM('Table'[Collateral])),
    ALLEXCEPT('Table','Table'[Customer])
)
LTV Intervall Group = 
SWITCH(
    TRUE(),
    [LTV Group]<=0.25,"0-25%",
    [LTV Group]>0.25&&[LTV Group]<=0.5,"25-50%",
    [LTV Group]>0.5&&[LTV Group]<=0.75,"50-75%",
    [LTV Group]>0.75&&[LTV Group]<=1,"75-100%",
    [LTV Group]>1,"Above 100%"
)

 

Final output

vheqmsft_1-1706668467797.png

 

Best regards

Albert He

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Anonymous
Not applicable

Hi @nor303 ,
You can test this by following the steps in my pbix file. If my answer is correct, please mark it as accept as solution.

Best regards

Albert He

 

If this post helps, then please consider Accept it as the solutionton help the other members find it more quickly

nor303
Helper III
Helper III

One thought; this might be the wrong approach to present this properly. Since If I want to present the Loan values and the group Values the LTV Group will be match only with one loan, and I need to match it to the sum to make it right. So maybe this output would be better:

Step 2         
CustomerIDLoanOther loansValueCollateralLTVLTV IntervallLTV GroupLTV Intervall Group
A1111012092 %75-100%62 %50-75%
A1315227063 %50-75%62 %50-75%
A158120143 %25-50%62 %50-75%
B21518075 %75-100%46 %25-50%
B2325055542 %25-50%46 %25-50%
C3310218163 %50-75%63 %50-75%
D417025028 %25-50%68 %50-75%
D4320537068 %50-75%68 %50-75%
D455460150 %Above 100%68 %50-75%
D47140121108 %Above 100%68 %50-75%

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.