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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi guys!
I need some help with this.
I am trying to build a function that allows me to assign a given number to a day of the week and then add those amounts between two dates that can be selected according to another table context.
I have managed to make this filter, and identify in a single column the values to be summed.
VAR HORASINTERM =
SELECTCOLUMNS (
ADDCOLUMNS (
FILTER (
'Calendario académico',
'Calendario académico'[fecha] > DATE ( 2022, 04, 01 )
&& 'Calendario académico'[fecha] < TODAY ()
),
"HorasInterm",
IF (
'Calendario académico'[dia_lab] = "True",
IF ( 'Calendario académico'[dia_semana] = "6", 10, 12 ),
0
)
),
"COLUMNAF[HorasInterm2]", [HorasInterm]
)And this is the ouput
So, I need SUM the values of this columns, but, I get the error "The SUM function only accepts a column reference as argument".
I have been reading documentation, and apparently, it is not possible because the SUM function only allows the use of a table column, and when I create a table, and assign it to a measure, it is not treated strictly as a table and therefore, there is no column to execute the sum.
P.S.: the variable will not be used to create a table, but to calculate it with other variables in the creation of a column.
Any idea how to solve it?
Thanks!
Solved! Go to Solution.
hi @Anonymous
you are right. SUM cannot do that but SUMX can. You can even skip the SELECTCOLUMNS part and use
SUMX ( HORASINTERM, [HorasInterm] )
hi @Anonymous
you are right. SUM cannot do that but SUMX can. You can even skip the SELECTCOLUMNS part and use
SUMX ( HORASINTERM, [HorasInterm] )
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 32 | |
| 31 | |
| 18 | |
| 12 | |
| 11 |