<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to Summarize Percentile Bins in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2977413#M99720</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;indpendent from the visual you should have the table in Power BI with the columns&lt;BR /&gt;PolicyNumber, BondAmount, and BLevel as your measure in the calculated column will assign the BLevel to every record you have (this is every policy number).&lt;BR /&gt;If this is the case then the matrix visual should have the columns BLevel and Policy Number in the row section and the BondAmount in the value section of the visual. Then you have for every bin level the breakdown of the policies in the bin and the subtotal of the amount per bin.&lt;/P&gt;&lt;P&gt;This is at least what I reproduced in my test file.&lt;/P&gt;&lt;P&gt;If this is not what you need let me know and I have a look at it tomorrow.&lt;/P&gt;&lt;P&gt;What you have above as screen shot looks like the table visual not the matrix visual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;</description>
    <pubDate>Mon, 19 Dec 2022 20:09:02 GMT</pubDate>
    <dc:creator>scee07</dc:creator>
    <dc:date>2022-12-19T20:09:02Z</dc:date>
    <item>
      <title>How to Summarize Percentile Bins</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2974062#M99516</link>
      <description>&lt;P&gt;Hi all! Trying to create a table showing total counts and sum of amounts for 10 "Percentile" bands. I've managed to create a measure which will dynamically update a percentile value for each row when I put it into a visual, but can't wrap my head around how to show totals for each of the ten Bins.&amp;nbsp;&lt;BR /&gt;So far I have this measure:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;BinBondLevel =
Var Bin01 = calculate(PERCENTILEX.INC(DMBond,DMBond[BondAmount],0.1),ALLSELECTED(DMBond))
Var Bin02 = calculate(PERCENTILEX.INC(DMBond,DMBond[BondAmount],0.2),ALLSELECTED(DMBond))
Var Bin03 = calculate(PERCENTILEX.INC(DMBond,DMBond[BondAmount],0.3),ALLSELECTED(DMBond))
Var Bin04 = calculate(PERCENTILEX.INC(DMBond,DMBond[BondAmount],0.4),ALLSELECTED(DMBond))
Var Bin05 = calculate(PERCENTILEX.INC(DMBond,DMBond[BondAmount],0.5),ALLSELECTED(DMBond))
Var Bin06 = calculate(PERCENTILEX.INC(DMBond,DMBond[BondAmount],0.6),ALLSELECTED(DMBond))
Var Bin07 = calculate(PERCENTILEX.INC(DMBond,DMBond[BondAmount],0.7),ALLSELECTED(DMBond))
Var Bin08 = calculate(PERCENTILEX.INC(DMBond,DMBond[BondAmount],0.8),ALLSELECTED(DMBond))
Var Bin09 = calculate(PERCENTILEX.INC(DMBond,DMBond[BondAmount],0.9),ALLSELECTED(DMBond))
return
SWITCH(true(),
SELECTEDVALUE(DMBond[BondAmount])&amp;lt;=Bin01, 1,
SELECTEDVALUE(DMBond[BondAmount])&amp;lt;=Bin02, 2,
SELECTEDVALUE(DMBond[BondAmount])&amp;lt;=Bin03, 3,
SELECTEDVALUE(DMBond[BondAmount])&amp;lt;=Bin04, 4,
SELECTEDVALUE(DMBond[BondAmount])&amp;lt;=Bin05, 5,
SELECTEDVALUE(DMBond[BondAmount])&amp;lt;=Bin06, 6,
SELECTEDVALUE(DMBond[BondAmount])&amp;lt;=Bin07, 7,
SELECTEDVALUE(DMBond[BondAmount])&amp;lt;=Bin08, 8,
SELECTEDVALUE(DMBond[BondAmount])&amp;lt;=Bin09, 9,
10)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This allows me to insert the field into my visual (below), but now I'm stuck on how to aggregate to show:&lt;BR /&gt;a) 10 rows, one for each Bin;&lt;BR /&gt;b) the count of items and sum of amounts within each Bin;&lt;BR /&gt;c) The Bin upper limit amount as a label&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Thanks for looking!&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 19:46:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2974062#M99516</guid>
      <dc:creator>Chochum</dc:creator>
      <dc:date>2022-12-16T19:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to Summarize Percentile Bins</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2974531#M99557</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you put your measure for a level in a calculated column in the base table&amp;nbsp; 'DMBond', you have all the fields you need in one table:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;BLevel = [BinBondLevel]&lt;/LI-CODE&gt;&lt;P&gt;It will pick up the row context via calculate transform into the filter context and give you the level for each policy.&lt;/P&gt;&lt;P&gt;Then, if you use the matrix visual you will see the subtotals for each bin for the sum and the count as values.&lt;/P&gt;&lt;P&gt;As you do not seem to have millons of policies, the additional storage for the calculated column should not be an issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Dec 2022 10:57:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2974531#M99557</guid>
      <dc:creator>scee07</dc:creator>
      <dc:date>2022-12-17T10:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to Summarize Percentile Bins</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2977238#M99704</link>
      <description>&lt;P&gt;Thanks Christian! When I convert the measure to a calculated field (never even realized this was possible) via:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;BLevel = [BinBondLevel]&lt;BR /&gt;It seems to evaluate at the individual row level and sets a BLevel value of 10 see below). Similarly, the matrix visual groups them all into a BLevel of 10.&lt;BR /&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;Any suggestions for next steps? Thanks!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 19 Dec 2022 17:44:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2977238#M99704</guid>
      <dc:creator>Chochum</dc:creator>
      <dc:date>2022-12-19T17:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to Summarize Percentile Bins</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2977413#M99720</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;indpendent from the visual you should have the table in Power BI with the columns&lt;BR /&gt;PolicyNumber, BondAmount, and BLevel as your measure in the calculated column will assign the BLevel to every record you have (this is every policy number).&lt;BR /&gt;If this is the case then the matrix visual should have the columns BLevel and Policy Number in the row section and the BondAmount in the value section of the visual. Then you have for every bin level the breakdown of the policies in the bin and the subtotal of the amount per bin.&lt;/P&gt;&lt;P&gt;This is at least what I reproduced in my test file.&lt;/P&gt;&lt;P&gt;If this is not what you need let me know and I have a look at it tomorrow.&lt;/P&gt;&lt;P&gt;What you have above as screen shot looks like the table visual not the matrix visual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 20:09:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2977413#M99720</guid>
      <dc:creator>scee07</dc:creator>
      <dc:date>2022-12-19T20:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to Summarize Percentile Bins</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2979571#M99863</link>
      <description>&lt;P&gt;Thanks Christian,&lt;BR /&gt;I'd only listed as a table as it made the calculations more visible...when I structure the matrix in the way you describe, it groups everyone into Bin 10:&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;Included the original BinBondLevel field in this matrix just to show that measure is still calculating as expected, it's just when I add it as a calculated column in the table does it convert to a value of 10:&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 16:38:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2979571#M99863</guid>
      <dc:creator>Chochum</dc:creator>
      <dc:date>2022-12-20T16:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to Summarize Percentile Bins</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2979612#M99864</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;just to be clear:&amp;nbsp; if you put your measure as additional calculated column in your Power BI table (not the table visual, the model table), do you get your desired result in the column: the bin assignement for every record in your table?&lt;BR /&gt;When I took your measure this worked for my model table. In other words, do you face the problem in the model table or only in the visual?&lt;BR /&gt;Best regards&amp;nbsp;&lt;BR /&gt;Christian&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 16:51:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2979612#M99864</guid>
      <dc:creator>scee07</dc:creator>
      <dc:date>2022-12-20T16:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to Summarize Percentile Bins</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2979772#M99872</link>
      <description>&lt;P&gt;When I pull up the pertninant records in the PowerBI table, they all show the same value of 10. It appears as though the original measure works as expected when dropped into a visual (filters applied force a recalc based on what's on the screen and bins them correctly), but when I turn it into Calculated Column from the measure it no longer responds the same way to the applied filters. I also confirmed going to the filters and selecting/deselecting items has no impact the Calculated Column. Appreciate your attention!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 18:12:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2979772#M99872</guid>
      <dc:creator>Chochum</dc:creator>
      <dc:date>2022-12-20T18:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to Summarize Percentile Bins</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2980832#M99921</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;let's recap this on order to see if we are really on the same page:&lt;/P&gt;&lt;P&gt;I have a toy table 'DMBond' with policy numbers from 1 to 100 and some random bond amount values.&lt;/P&gt;&lt;P&gt;The measure BinBondLevel is exactly your measure. The calculated column is just your measure put in this calculated column. You see below that this is putting every record on one of the 10 bins.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;This is the very definition of binning: take a record put it in one of the bins.&lt;/P&gt;&lt;P&gt;Now I just use the matrix visual to show the transactions per bin and the subtotals:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems you want to present something differently. At the moment I do not understand what else, as the maximum information you have is the transactions per bin. And your measure put in the calculated column does this.&amp;nbsp;&lt;BR /&gt;Let me know and we solve this.&lt;BR /&gt;Best regards&amp;nbsp;&lt;BR /&gt;Christian&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 06:37:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2980832#M99921</guid>
      <dc:creator>scee07</dc:creator>
      <dc:date>2022-12-21T06:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to Summarize Percentile Bins</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2982018#M99982</link>
      <description>&lt;P&gt;This solves one of my issues, and I can now easily group, subtotal, and provide counts by Bins. But the velues I see still don't seem to do what I would expect. If you add BinBondLevel to your Matrix, would the values always match those in ColumnFromOriginalMeasure?&amp;nbsp;&lt;BR /&gt;In my data, if I filter down to a small population of rows, I would always expect to see one row with a value 10 (max BondAmount for the selected population), and another with value 1 (min BondAmount). I rarely do.&lt;BR /&gt;&lt;BR /&gt;Here's an example with a small handful of Bonds where the ColumnFromOriginalMeasure (called BLevel on mine, but same thing) only has Bin values of 8 and 10. When I add the original measure as an additional value, the correct Bin is displayed.&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;As another validation step I created 9 measures, one for each Bin/Percentile level, just so I could ensure they updated correctly depending on my filtering. They do:&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;Super curious what you find if you add BinBondLevel to your matrix, and what happens to those values if you filter down your populated values.&lt;BR /&gt;&lt;BR /&gt;Thanks Christian, appreciate you joining me on this journey lol&lt;BR /&gt;Chris&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 14:17:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2982018#M99982</guid>
      <dc:creator>Chochum</dc:creator>
      <dc:date>2022-12-21T14:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to Summarize Percentile Bins</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2982138#M99988</link>
      <description>&lt;P&gt;Hi Chris,&amp;nbsp;&lt;/P&gt;&lt;P&gt;are the policy numbers in your table unique?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;You see, if I pull the measure in the visual the bin numbers are identical. And if the policy numbers are unique then the sum of BondAmount is exactly the amount in the row of the original table and the measure pulled into the visual must give the same bin number.&amp;nbsp;&lt;BR /&gt;if the policy number is not unique (a primary key in the table) then the bin number can be wrong. Interestingly enough you see that subtotals are evaluated by the measure and as they are the sum of eintire bin, they end up in bin 1, because they are big numbers in comparison (this is an issue of the visual, but this is an issue for later).&lt;BR /&gt;The the policy number not being a real primary key would be my guess. Or you do something which I cannot know.&lt;/P&gt;&lt;P&gt;Let me know.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 15:05:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2982138#M99988</guid>
      <dc:creator>scee07</dc:creator>
      <dc:date>2022-12-21T15:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to Summarize Percentile Bins</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2982168#M99992</link>
      <description>&lt;P&gt;Thanks Christian. Hmm, the mystery continues...they are indeed unique values. In your example, are there any filters applied? Let's say you filtered for items with a Bond Amount between $5 - $10K, do the values in both the Calculated Column and Measure update in sync?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 15:13:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2982168#M99992</guid>
      <dc:creator>Chochum</dc:creator>
      <dc:date>2022-12-21T15:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to Summarize Percentile Bins</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2982279#M99997</link>
      <description>&lt;P&gt;Ok, so the calculated column is never updated, because it is defined on the model table level.&amp;nbsp;&lt;/P&gt;&lt;P&gt;First we should agree that if you apply no filters then you should reproduce the bin number, like I do.&lt;/P&gt;&lt;P&gt;Now filters (was not filter your base table, I thought perhaps the entire table is update which would not have been an issue)&lt;/P&gt;&lt;P&gt;A calculated column in a model table will not work now. It has to be a virtual table in the measure that will do the job. Or just eliminating the ALLSELECTED might work (let's see).&lt;/P&gt;&lt;P&gt;I am busy today, but will work on this tomorrow.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Think about it: the reference for the percentile calculation is the total amount of the entire table regarded. By filtering you change the base table for the percentile calculation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Talk to you tomorrow. Best regards Christian&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 15:44:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2982279#M99997</guid>
      <dc:creator>scee07</dc:creator>
      <dc:date>2022-12-21T15:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to Summarize Percentile Bins</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2982451#M100004</link>
      <description>&lt;P&gt;Can't thank you enough! I'll try removing the ALLSELECTED tomorrow as well.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 16:54:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2982451#M100004</guid>
      <dc:creator>Chochum</dc:creator>
      <dc:date>2022-12-21T16:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to Summarize Percentile Bins</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2983695#M100064</link>
      <description>&lt;P&gt;Hi Chris, here is my outline of a solution:&lt;BR /&gt;the first observation is, when the calculated column is gone, then measures cannot (to my knowledge) be rows or colunns of visuals. Thus, I create a table all bin and policy number combinations:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;// a table with the bin numbers
Bins =
SELECTCOLUMNS ( GENERATESERIES ( 1, 10, 1 ), "Bin", [Value] )
// all combinations of values
BinBondCombinations =
CROSSJOIN (
    SELECTCOLUMNS ( Bins, "Bin", Bins[Bin] ),
    SUMMARIZE ( ALL ( DMBond ), DMBond[PolicyNumber] )
)&lt;/LI-CODE&gt;&lt;P&gt;Idea is to check for each combination, if the amount for the policy is in the bin.&lt;BR /&gt;The we have our slicer that can select amount ranges (the standard slicer applied to the bond amount). We need 2 measures for the max and min amount for the selected bond amount:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MaxAmount =
MAX ( DMBond[BondAmount] )
MinAmount =
MIN ( DMBond[BondAmount] )&lt;/LI-CODE&gt;&lt;P&gt;Now your measure&amp;nbsp; is modified to pick up the selected bin and policy number from the combinations:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;PolicyIsinBinAmount = 
VAR thisPolicyNumber = SELECTEDVALUE(BinBondCombinations[PolicyNumber])
var thisBin = SELECTEDVALUE(BinBondCombinations[Bin])
var thisAmount = CALCULATE(FIRSTNONBLANK(DMBond[BondAmount],0), Filter(All(DMBond), DMBond[PolicyNumber] = thisPolicyNumber))
var isInRange = thisAmount &amp;gt;= [MinAmount] &amp;amp;&amp;amp; thisAmount &amp;lt;= [MaxAmount]

Var Bin01 = calculate(PERCENTILEX.INC(DMBond,DMBond[BondAmount],0.1),DMBond)
Var Bin02 = calculate(PERCENTILEX.INC(DMBond,DMBond[BondAmount],0.2),DMBond)
Var Bin03 = calculate(PERCENTILEX.INC(DMBond,DMBond[BondAmount],0.3),DMBond)
Var Bin04 = calculate(PERCENTILEX.INC(DMBond,DMBond[BondAmount],0.4),DMBond)
Var Bin05 = calculate(PERCENTILEX.INC(DMBond,DMBond[BondAmount],0.5),DMBond)
Var Bin06 = calculate(PERCENTILEX.INC(DMBond,DMBond[BondAmount],0.6),DMBond)
Var Bin07 = calculate(PERCENTILEX.INC(DMBond,DMBond[BondAmount],0.7),DMBond)
Var Bin08 = calculate(PERCENTILEX.INC(DMBond,DMBond[BondAmount],0.8),DMBond)
Var Bin09 = calculate(PERCENTILEX.INC(DMBond,DMBond[BondAmount],0.9),DMBond)

var calculatedBin = SWITCH(true(),
thisAmount&amp;lt;=Bin01, 1,
thisAmount&amp;lt;=Bin02, 2,
thisAmount&amp;lt;=Bin03, 3,
thisAmount&amp;lt;=Bin04, 4,
thisAmount&amp;lt;=Bin05, 5,
thisAmount&amp;lt;=Bin06, 6,
thisAmount&amp;lt;=Bin07, 7,
thisAmount&amp;lt;=Bin08, 8,
thisAmount&amp;lt;=Bin09, 9,
10)
return 

if(isInRange &amp;amp;&amp;amp; (thisBin = calculatedBin), thisAmount)
&lt;/LI-CODE&gt;&lt;P&gt;If this is not the right amount for the bin&amp;nbsp; a blank() is returned.&lt;/P&gt;&lt;P&gt;The DMBond is now restricted to the amounts in the range selected. This means your bins should adjust dynamically.&lt;/P&gt;&lt;P&gt;Now, you can pull the combinations of bin and policy number in the rows of the matrix and the measure in the value section. However, the subtotals are not working then (see screenshot below).&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have to wrap the measure in a summable measure (this is a pure technically)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;PolicyIsInBinAmountWrapped =
VAR tab =
    SUMMARIZE (
        BinBondCombinations,
        BinBondCombinations[Bin],
        BinBondCombinations[PolicyNumber],
        "measure", [PolicyIsinBinAmount]
    )
RETURN
    SUMX ( tab, [measure] )&lt;/LI-CODE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is not tested. Let me know what you can make of this.&lt;BR /&gt;Best regards&amp;nbsp;&lt;BR /&gt;Christian&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 08:30:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/2983695#M100064</guid>
      <dc:creator>scee07</dc:creator>
      <dc:date>2022-12-22T08:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to Summarize Percentile Bins</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/3254825#M120163</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to calculate deciles&amp;nbsp;&lt;SPAN&gt;that would be responsive to several filters/slicers in the report view, which come from different tables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Model view:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Link to data source:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.google.com/spreadsheets/d/1aRCwOmyTxZvV5P-UobNtLOpV1B7mq1jeE3SEs-FMDRE/edit#gid=1463157703" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.google.com/spreadsheets/d/1aRCwOmyTxZvV5P-UobNtLOpV1B7mq1jeE3SEs-FMDRE/edit#gid=1463157...&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;correct&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;example below that I would like to get:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;incorrect&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;values I get in Power BI:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sample code I've used:&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Decile demo ChatGPT = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; SelectedValue = &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;('Financial items'[Value_usd])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SWITCH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;TRUE&lt;/SPAN&gt;&lt;SPAN&gt;(),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SelectedValue &amp;lt;= &lt;/SPAN&gt;&lt;SPAN&gt;PERCENTILEX.INC&lt;/SPAN&gt;&lt;SPAN&gt;('Financial items', 'Financial items'[Value_usd], &lt;/SPAN&gt;&lt;SPAN&gt;0.1&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;"1st Decile"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SelectedValue &amp;lt;= &lt;/SPAN&gt;&lt;SPAN&gt;PERCENTILEX.INC&lt;/SPAN&gt;&lt;SPAN&gt;('Financial items', 'Financial items'[Value_usd], &lt;/SPAN&gt;&lt;SPAN&gt;0.2&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;"2nd Decile"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SelectedValue &amp;lt;= &lt;/SPAN&gt;&lt;SPAN&gt;PERCENTILEX.INC&lt;/SPAN&gt;&lt;SPAN&gt;('Financial items', 'Financial items'[Value_usd], &lt;/SPAN&gt;&lt;SPAN&gt;0.3&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;"3rd Decile"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SelectedValue &amp;lt;= &lt;/SPAN&gt;&lt;SPAN&gt;PERCENTILEX.INC&lt;/SPAN&gt;&lt;SPAN&gt;('Financial items', 'Financial items'[Value_usd], &lt;/SPAN&gt;&lt;SPAN&gt;0.4&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;"4th Decile"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SelectedValue &amp;lt;= &lt;/SPAN&gt;&lt;SPAN&gt;PERCENTILEX.INC&lt;/SPAN&gt;&lt;SPAN&gt;('Financial items', 'Financial items'[Value_usd], &lt;/SPAN&gt;&lt;SPAN&gt;0.5&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;"5th Decile"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SelectedValue &amp;lt;= &lt;/SPAN&gt;&lt;SPAN&gt;PERCENTILEX.INC&lt;/SPAN&gt;&lt;SPAN&gt;('Financial items', 'Financial items'[Value_usd], &lt;/SPAN&gt;&lt;SPAN&gt;0.6&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;"6th Decile"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SelectedValue &amp;lt;= &lt;/SPAN&gt;&lt;SPAN&gt;PERCENTILEX.INC&lt;/SPAN&gt;&lt;SPAN&gt;('Financial items', 'Financial items'[Value_usd], &lt;/SPAN&gt;&lt;SPAN&gt;0.7&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;"7th Decile"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SelectedValue &amp;lt;= &lt;/SPAN&gt;&lt;SPAN&gt;PERCENTILEX.INC&lt;/SPAN&gt;&lt;SPAN&gt;('Financial items', 'Financial items'[Value_usd], &lt;/SPAN&gt;&lt;SPAN&gt;0.8&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;"8th Decile"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SelectedValue &amp;lt;= &lt;/SPAN&gt;&lt;SPAN&gt;PERCENTILEX.INC&lt;/SPAN&gt;&lt;SPAN&gt;('Financial items', 'Financial items'[Value_usd], &lt;/SPAN&gt;&lt;SPAN&gt;0.9&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;"9th Decile"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SelectedValue &amp;lt;= &lt;/SPAN&gt;&lt;SPAN&gt;PERCENTILEX.INC&lt;/SPAN&gt;&lt;SPAN&gt;('Financial items', 'Financial items'[Value_usd], &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;"10th Decile"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Many thanks in advance&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2023 08:24:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-Summarize-Percentile-Bins/m-p/3254825#M120163</guid>
      <dc:creator>MartynasBI</dc:creator>
      <dc:date>2023-05-26T08:24:27Z</dc:date>
    </item>
  </channel>
</rss>

