Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Outstanding amount with drill up

Hi all,

 

I hope someone can help me out. I am trying to do the following:

 

In the dataset, I have a table named 'loan_balance'. In this loan balance table there can be multiple records for one loan number with the corresponding outstanding amount in the same row.

 

Each row has a valid_from and valid_to date.

 

I then made a table to plot all the outstanding amount for each loan number for each date in the calander table:

 

 

Lening balans historie = 
filter(
GENERATE(ALLNOBLANKROW('Kalender werkvoorraad'[Datum]),
CALCULATETABLE(
var meetdatum = SELECTEDVALUE( 'Kalender werkvoorraad'[Datum])
 
var temptabel = 
filter('Lening balans', 'Lening balans'[credit_balance_valid_from] <= meetdatum &&
('Lening balans'[credit_balance_valid_to] > meetdatum || isblank('Lening balans'[credit_balance_valid_to]))
&& 'Lening balans'[credit_valid_from] <= meetdatum &&
('Lening balans'[credit_valid_to] > meetdatum || isblank('Lening balans'[credit_valid_to]))) 


return selectcolumns(temptabel, "source loan part id", 'Lening balans'[source_loan_part_id], "outstanding amount", 'Lening balans'[outstanding_amount])
)
), [outstanding amount] <> 0)

 

 

This table has a relationship with my general calander table. In this calender table there is a date hierarchy.

 

I then made a measure to determine the outstanding amount:

 

 

calculate(SUM('Lening balans historie'[outstanding amount]), USERELATIONSHIP(Kalender[Datum],'Lening balans historie'[Datum]))

 

 

This works when I show the information on date level. But once I drill up to week or month level, this does not work well.. This is because the outstanding amount is plotted for each date, so the outstanding amount will summarize, also for each date within the month (although the amount for example stayed the same). 

 

How can I make this work on week or month level? 

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anyone who can help me with this? 🙂

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous ,

       

      It seems that you create calcualted table based some other tables. Please share a sample file with me and show me a screenshot with the result you want. This will make it easier for us to find the solution.

       

      Best Regards,
      Rico Zhou

       

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

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous , thanks!

         

        I cannot share the Power BI file, since it contains confidential information.

         

        I am able to share the table layouts and relationships.

         

        The DAX table is based on a 'loan balance' table, it contains 4 columns:

         

        Loan ID, valid from, valid to, balance

         

        The calander table contains 3 columns and a hierarchy:

         

        Date, weeknumber (yyyy-ww), monthnumber (yyyy-mm) and the hierarchy is as follows:

         

        In the visualisation it looks as follows:

         

        On the highest level:

         

         

        When I drill down to weeklevel:

         

         

         

        And daylevel:

         

         

         

        The only correct representation right now is on day level. This is because my measure summarizes the balance amount. Once I drill up, it keeps summarizing my balance amount, which is logical of course. In the DAX table there is a record for every loan ID for each day, and the balance amount does not change every day.

         

        What I want to see

         

        On every level in the hierarchy, it should show me a sum of the average outstanding amount per loan ID.

        I hope I clarified some things. Please let me know if you need further information.