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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have produced the following VAR (temporary) table called 'Tabela_CP_DiasxValor_DiasPeso_Dias' with 300+ rows:
What I need is to come up with another VAR table that basically summarizes the vendors column highlighted to the left and group them so I get on a second column the total of "@Dias" highlighted to the right for each vendor.
I tried doing that with the following code:
VAR Tabela_CP_DiasporForn =
SUMMARIZE(
Tabela_CP_DiasxValor_DiasPeso_Dias,
[Código - Nome do fornecedor],
"@DiasSoma", SUMX(Tabela_CP_DiasxValor_DiasPeso_Dias, [@Dias])
)
But what I end up getting is the summarized table (100+ rows, which is correct) but with the overall total of "@Dias" instead of the total by row/vendor:
I tried going with SUM instead of SUMX but DAX won't take the [@Days] column since it comes from the previous VAR table, and CALCULATE produces the same outcome.
How can I get that done? Any help is appreciated!
Solved! Go to Solution.
@leolapa_br Use GROUPBY with SUMX( CURRENTGROUP(), [@Days] )
GROUPBY is cleaner but another option would be to filter Tabela inside the SUMX.
VAR Tabela_CP_DiasporForn =
ADDCOLUMNS (
SUMMARIZE ( Tabela_CP_DiasxValor_DiasPeso_Dias, [Código - Nome do fornecedor] ),
"@DiasSoma",
VAR _Codigo = [Código - Nome do fornecedor]
RETURN
SUMX (
FILTER (
Tabela_CP_DiasxValor_DiasPeso_Dias,
[Código - Nome do fornecedor] = _Codigo
),
[@Dias]
)
)
@leolapa_br Use GROUPBY with SUMX( CURRENTGROUP(), [@Days] )
GROUPBY is cleaner but another option would be to filter Tabela inside the SUMX.
VAR Tabela_CP_DiasporForn =
ADDCOLUMNS (
SUMMARIZE ( Tabela_CP_DiasxValor_DiasPeso_Dias, [Código - Nome do fornecedor] ),
"@DiasSoma",
VAR _Codigo = [Código - Nome do fornecedor]
RETURN
SUMX (
FILTER (
Tabela_CP_DiasxValor_DiasPeso_Dias,
[Código - Nome do fornecedor] = _Codigo
),
[@Dias]
)
)
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 9 | |
| 9 | |
| 8 | |
| 6 | |
| 6 |
| User | Count |
|---|---|
| 20 | |
| 18 | |
| 16 | |
| 14 | |
| 14 |