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
JK_29
Frequent Visitor

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.

2 ACCEPTED SOLUTIONS

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.

View solution in original post

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

View solution in original post

6 REPLIES 6
v-easonf-msft
Community Support
Community Support

Hi, @JK_29 

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

veasonfmsft_0-1661150899045.png

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] ))
)

veasonfmsft_1-1661152238067.png

Best Regards,
Community Support Team _ Eason

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])))

JK_29_1-1661683245393.png

 

 

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

lbendlin
Super User
Super User

Use a disconnected table with the desired bucket values.  Then adjust your measure to include that table into the visual

 

Dynamic Segmentation/ Bucketing/ Binning - Microsoft Power BI Community

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?

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.

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.