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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
nor303
Helper II
Helper II

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
v-heq-msft
Community Support
Community Support

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

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
v-heq-msft
Community Support
Community Support

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

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 II
Helper II

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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