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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
JVDW_VSH
Frequent Visitor

Table with records >= threshold and the rest with variable liine

I have a table with debtors and a simple measure that calculates the open amount.

I would like to have a matrix that shows the debtors for which the total open amount is >= [a variable number] based on a numeric parameter and then have an additional row that reads "Others (< [variable number] )".

Let's say my data looks like this:

 

DebtorAmount open
org A50
org B110
org C30
org A60
org D99
org E5

 

For which I have created a numeric parameter which I can slide between 0 and 200. Let's say I pick the number 100 here.
I would like to show the result as:

DebtorAmount open
org A110
org B110
Others (< 100)134
Total354


If I change the numeric parameter to 50, I would like to show the result as:

 

DebtorAmount open
org A110
org B110
org D99
Others (< 50)35
Total354

 

I have created a calculated table where I summarize the debtors (key and name) and union this with an additional ROW with a dummy key and the name "Others (< " & 

SELECTEDVALUE('Parameter'[Parameter]) & ")". 
The right debtors and Ohters row are shown, but I somehow can't get the selected variable in there.

Is a calculated table the right solution? (if so, why doesn't this selected value not work? if not, what would be a better approach?)
 
1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @JVDW_VSH 

Calculated tables update only upon creation or when the underlying or referenced tables have been modified. SELECTEDVALUE('external table'[column]) returns blank within the context of a calculated table as it is not aware of any slicer selections.  You will need to create a disconnected table that has all the debtor names and all other Other (< 50,100..) rows

danextian_0-1737979574554.png

and then use a measure that references this table.

Open Amount Grouped = 
VAR _summary =
    ADDCOLUMNS (
        SUMMARIZECOLUMNS ( Debtors[Debtor Name], "@value", [Open Amount] ),
        "@group",
            IF (
                [@value] >= [Open Amount Value],
                [Debtor Name],
                FORMAT ( [Open Amount Value], "0" )
            )
    )
VAR _filtered =
    FILTER ( _summary, [@group] IN VALUES ( 'Debtors with Others'[Group] ) )
VAR _result =
    SUMX ( _filtered, [@value] )
RETURN
    _result

danextian_1-1737979691184.png

 

 

Please see the attached sample pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

2 REPLIES 2
danextian
Super User
Super User

Hi @JVDW_VSH 

Calculated tables update only upon creation or when the underlying or referenced tables have been modified. SELECTEDVALUE('external table'[column]) returns blank within the context of a calculated table as it is not aware of any slicer selections.  You will need to create a disconnected table that has all the debtor names and all other Other (< 50,100..) rows

danextian_0-1737979574554.png

and then use a measure that references this table.

Open Amount Grouped = 
VAR _summary =
    ADDCOLUMNS (
        SUMMARIZECOLUMNS ( Debtors[Debtor Name], "@value", [Open Amount] ),
        "@group",
            IF (
                [@value] >= [Open Amount Value],
                [Debtor Name],
                FORMAT ( [Open Amount Value], "0" )
            )
    )
VAR _filtered =
    FILTER ( _summary, [@group] IN VALUES ( 'Debtors with Others'[Group] ) )
VAR _result =
    SUMX ( _filtered, [@value] )
RETURN
    _result

danextian_1-1737979691184.png

 

 

Please see the attached sample pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
bhanu_gautam
Super User
Super User

@JVDW_VSH , Can you share DAX of calculated table




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.