Forum Discussion
Parameter in summarize
- Anonymous1 year ago
Hi Anonymous ,
Thank you for reaching out to us on Microsoft Fabric Community Forum. Also thanks Nasif_Azam and rajendraongole1 for the helpful insights!
I tried to recreate it on my local upon my understanding.Please refer the screenshot and file for your reference.
If this answer meets your requirement,give us kudos and consider accepting it as solution.If still require further assistance, feel free to reachout!
Regards,
Pallavi G.
Hey Anonymous ,
The issue you're encountering is "Value which is in the Threshold variable is not getting passed". The value in the Threshold variable is not getting passed properly in your SUMMARIZE logic is often due to context transition or the way Threshold is referenced within the nested row context of FILTER and ADDCOLUMNS.
Root Cause
The variable Threshold is a scalar defined outside of the FILTER expression, but inside the ADDCOLUMNS, you're operating within a row context introduced by SUMMARIZE, which does not automatically convert into a filter context. As a result, DAX may not correctly evaluate Threshold for each row especially when used in CALCULATE inside ADDCOLUMNS.
Use VAR and restructure your code like this:
Filtered_Customs_Data_Input =
VAR Threshold = [Parameter Value] -- e.g., 500
VAR CustomsWithTotal =
ADDCOLUMNS(
SUMMARIZE('CBAM_Goods_InScope', [EntryIdentifier]),
"TotalCustomsValue", CALCULATE(SUM('CBAM_Goods_InScope'[CustomsValue]))
)
VAR FilteredIdentifiers =
FILTER(
CustomsWithTotal,
[TotalCustomsValue] > Threshold
)
RETURN
FILTER(
'CBAM_Goods_InScope',
'CBAM_Goods_InScope'[EntryIdentifier] IN
SELECTCOLUMNS(FilteredIdentifiers, "EntryIdentifier", [EntryIdentifier])
)Alternative: Use a Measure Instead of Variable
If [Parameter Value] is dynamic (like a disconnected slicer table), consider creating a measure and referencing it instead:
Threshold Measure = SELECTEDVALUE('Parameter Table'[Value])And then:
VAR Threshold = [Threshold Measure]
Things to remember
Always compute columns before filtering when dealing with nested contexts.
Use SELECTCOLUMNS or VALUES to extract clean lists for use in IN clauses.
Ensure Threshold is a scalar value — not a table or column.
If you found this solution helpful, please consider accepting it and giving it a kudos (Like) it’s greatly appreciated and helps others find the solution more easily.
Best Regards,
Nasif Azam
- Anonymous1 year agoNot applicable
this is not working as well...
- Nasif_Azam1 year ago
Super User
Thanks for the update. If the revised approach didn’t solve the issue, let’s take a deeper look at possible reasons and other workarounds:
Potential Issues
[Parameter Value] might not be evaluated as expected
If [Parameter Value] is coming from a slicer or a disconnected table, it must be a scalar. Use SELECTEDVALUE() to ensure it returns a single value:
VAR Threshold = SELECTEDVALUE('Parameter Table'[Value], 500) // fallback to 500
Threshold might be blank
If no value is selected in the parameter slicer, [Parameter Value] may return blank, causing all rows to be filtered out. You can guard against this with:
VAR Threshold = IF(ISBLANK(SELECTEDVALUE('Parameter Table'[Value])), 0, SELECTEDVALUE('Parameter Table'[Value]))
Data Type Mismatch
Double-check if CustomsValue and the parameter are both numeric. If one is text and the other is numeric, the comparison may silently fail.
Try this full version with explicit fallback and clean context flow:
Filtered_Customs_Data_Input = VAR Threshold = SELECTEDVALUE('Parameter Table'[Value], 0) // default to 0 if nothing selected VAR CustomsWithTotal = ADDCOLUMNS( SUMMARIZE('CBAM_Goods_InScope', [EntryIdentifier]), "TotalCustomsValue", CALCULATE(SUM('CBAM_Goods_InScope'[CustomsValue])) ) VAR FilteredIdentifiers = FILTER( CustomsWithTotal, [TotalCustomsValue] > Threshold ) RETURN FILTER( 'CBAM_Goods_InScope', 'CBAM_Goods_InScope'[EntryIdentifier] IN SELECTCOLUMNS(FilteredIdentifiers, "EntryIdentifier", [EntryIdentifier]) )Debug Tip
Temporarily add a measure like this to check what your parameter is returning:
Measure_CheckThreshold = SELECTEDVALUE('Parameter Table'[Value])Add it to a card visual to verify it’s not blank or unexpected.
If you found this solution helpful, please consider accepting it and giving it a kudos (Like) it’s greatly appreciated and helps others find the solution more easily.
Best Regards,
Nasif Azam- Anonymous1 year agoNot applicable
Nasif_Azam Thanks a lot for your quick response. Not sure if your response is generated by Chat GPT but it is not giving expected output.