Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi can anyone help me correct my calculated column, i want the sum of remaining of group1 and 2 on my column. Show error when i try to used below.
Solved! Go to Solution.
Hi,
I am not sure how the expected result looks like, but please try something like below, and please check whether it works.
Thank you.
TA_Total_Column_Remaining =
VAR CurrentDate =
TODAY ()
VAR CurrentGroup = { "Group01", "Group02" }
RETURN
CALCULATE (
SUM ( 'Table'[Remaining] ),
FILTER (
'Table',
'Table'[PlanDate] = CurrentDate && 'Table'[Trade] IN CurrentGroup
)
)
Hi @AllanBerces
The error in your DAX formula occurs because of how you are using the variable CurrentGroup and the IN operator. In DAX, you can’t assign a logical expression like 'Table'[Trade] IN {"Group01", "Group02"} to a variable and then later compare a column directly to that variable — it results in an invalid data type or logical context error. Also, using CALCULATE inside a calculated column can behave unexpectedly, since it changes the evaluation context for each row, not for an aggregated total. To correctly get the sum of the ‘Remaining’ column for only Group01 and Group02 on the same PlanDate as the current row, you can rewrite your formula like this:
TA_Total_Column_Remaining =
VAR CurrentDate = 'Table'[PlanDate]
RETURN
CALCULATE(
SUM('Table'[Remaining]),
FILTER(
'Table',
'Table'[PlanDate] = CurrentDate &&
'Table'[Trade] IN {"Group01", "Group02"}
)
)
In this corrected version, the variable CurrentDate stores the row’s PlanDate, and the FILTER function checks for rows in the table that share that same date and belong to Group01 or Group02. The SUM inside CALCULATE then adds up the “Remaining” values for those matching rows. This ensures that for each row in your table, the calculated column correctly displays the total “Remaining” amount for both groups combined for that specific date.
Hi @AllanBerces
The error in your DAX formula occurs because of how you are using the variable CurrentGroup and the IN operator. In DAX, you can’t assign a logical expression like 'Table'[Trade] IN {"Group01", "Group02"} to a variable and then later compare a column directly to that variable — it results in an invalid data type or logical context error. Also, using CALCULATE inside a calculated column can behave unexpectedly, since it changes the evaluation context for each row, not for an aggregated total. To correctly get the sum of the ‘Remaining’ column for only Group01 and Group02 on the same PlanDate as the current row, you can rewrite your formula like this:
TA_Total_Column_Remaining =
VAR CurrentDate = 'Table'[PlanDate]
RETURN
CALCULATE(
SUM('Table'[Remaining]),
FILTER(
'Table',
'Table'[PlanDate] = CurrentDate &&
'Table'[Trade] IN {"Group01", "Group02"}
)
)
In this corrected version, the variable CurrentDate stores the row’s PlanDate, and the FILTER function checks for rows in the table that share that same date and belong to Group01 or Group02. The SUM inside CALCULATE then adds up the “Remaining” values for those matching rows. This ensures that for each row in your table, the calculated column correctly displays the total “Remaining” amount for both groups combined for that specific date.
Hi,
Share some data to work with and show the expected result. Share data in a format that can be pasted in an MS Excel file.
Hi,
I am not sure how the expected result looks like, but please try something like below, and please check whether it works.
Thank you.
TA_Total_Column_Remaining =
VAR CurrentDate =
TODAY ()
VAR CurrentGroup = { "Group01", "Group02" }
RETURN
CALCULATE (
SUM ( 'Table'[Remaining] ),
FILTER (
'Table',
'Table'[PlanDate] = CurrentDate && 'Table'[Trade] IN CurrentGroup
)
)
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 54 | |
| 51 | |
| 39 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 93 | |
| 79 | |
| 37 | |
| 27 | |
| 25 |