Forum Discussion

JK_29's avatar
JK_29
Frequent Visitor
4 years ago
Solved

Using a measure for Bucketing data

I have two tabular sets as listed below, table A and table B.  Both the tables are connected using column assignment in table A and column Billing Doc in table B.

Table A

 
IDDocDocument DateAmountAssignment
2000101000724701-02-2022            50,000 
2000101000724801-02-2022         3,40,95960024141
200010900016023-07-2022         7,34,74560024031
2000161000482601-07-2022    3,84,74,87560024475
2000161400002826-07-2022            34,00060024475

 

  Table B

 
Billing DocDateIDP DocRealisable value
6002414121-04-2022200010702310203500000
6002447517-05-20222000167329300040000000
6002447517-05-20222000167329300040000000
6002447517-05-20222000167329300040000000
6002447517-05-20222000167329300040000000
6002447517-05-20222000167329300040000000
6002447517-05-20222000167329300040000000
6002414127-04-2022200010702310203500000
6002403130-04-2022200010738273778500000
6002414121-04-2022200010702310203500000
6002403121-04-2022200010738273778500000
6002403121-04-2022200010738273778500000

 

Have two measures, where one is finding a %ge value of two fields and other measure is to bucketize the first measure into various categories.

Measure 1

O/s % to P Doc = VAR RealizablevalueMax = CALCULATE(MAX(TableB[Realisable value]),FILTER(TableB,TableB[P Doc]))

                Return

                DIVIDE(sum(Table A[Amount in Doc Currency]),RealizablevalueMax)

 

Measure 2

DueBucket = IFERROR(IF([O/s % to P Doc] > .9, "Above 90% Due", IF([O/s % to P Doc] >.1, "Upto 90% due", IF([O/s % to P Doc] <.1, "Upto 10% Due",0))),0)

 

The final output is summarized values by Account column,

 
YearAccountP DocAmount in Local CurrencyRealisable valueO/s % to SOAssignmentDue Bucket
20222000107023102034095935000009.74%60024141Upto 10% Due
20222000107382737773474585000008.64%60024031Upto 10% Due
202220001073293000385088754000000096.27%60024475Above 90% Due

 

However, this bucket measure is not available for use in chart.  Any suggestions would help.

  • Your "amount in local currency" has to be a measure that is based on the logic for each item in your bucket table - whatever that logic is.

  • Hi, JK_29 

    The filter in your formula is performed in a Table called ‘measuretable’, you need replace it with fact table ’AR_details‘.

    Please check the formula in the pbix file I provided before.

     

    Best Regards,
    Community Support Team _ Eason

6 Replies

    • JK_29's avatar
      JK_29
      Frequent Visitor

      Thanks Ibendlin, I tried the solution through an independent table. However, my requirement is to sum the amount in local currency by the buckets defined.  I am unable to get that since the buckets table is not linked to AR  table.  How do we achieve a bar chart with buckets in x axis and amount in local currency in Y axis?

      • lbendlin's avatar
        lbendlin
        Super User

        Your "amount in local currency" has to be a measure that is based on the logic for each item in your bucket table - whatever that logic is.

  • v-easonf-msft's avatar
    v-easonf-msft
    Community Support

    Hi, JK_29 

    You need to enter a an independent table ‘Bucket’.

    The ‘Bucket’ table is not linked to AR but you can create a new meausre based on these two tables.

    Please add a measure like below and apply it to the x-axis.

    Amount in Local Currency =
    CALCULATE (
        SUM ( 'Table A'[Amount in Doc Currency] ),
        FILTER ( 'Table A', [DueBucket]=SELECTEDVALUE ( 'Due Bucket'[Bucket] ))
    )
    

    Best Regards,
    Community Support Team _ Eason

    • JK_29's avatar
      JK_29
      Frequent Visitor

      Hi,

      I tried using the measure for local currency amount, however, i am unable to get the graph in same fashion.   What could be wrong?  Here is the measure that I am using

      LocalCurr.agg = CALCULATE ( SUM ( AR_details[Amount in Local Currency]), FILTER(Measuretable,[DueBucket]= SELECTEDVALUE('Bucket Sizing'[Bucket])))

       

       

      • v-easonf-msft's avatar
        v-easonf-msft
        Community Support

        Hi, JK_29 

        The filter in your formula is performed in a Table called ‘measuretable’, you need replace it with fact table ’AR_details‘.

        Please check the formula in the pbix file I provided before.

         

        Best Regards,
        Community Support Team _ Eason