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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
maximum
New Member

How to sum the context of rows in an matrix visual

I've a measure that I can't resolve the row context.
The parent result should be '11' in this case, not 4 (because round value 3,9).

 

maximum_0-1664225784251.png

 

What am I doing wrong ?

SugestaoReposicao Teste =
VAR diasParametros = SELECTEDVALUE(ParamDiasEstoque[DiasAbastecerEstoque])
VAR qtdVendidaSSS = [Soma Qtde Produto Vendido SSS]
VAR dias = DISTINCTCOUNT('dCalendário'[Data])
VAR divisao = CEILING(DIVIDE(qtdVendidaSSS,dias,0),1)
VAR qtdParam = ROUNDUP(divisao,0) * diasParametros
return
CALCULATE(
    CEILING(diasParametros * [Média Diária de Qtde Produto Vendido SSS],1),
    ALLSELECTED(dClientes[Nome loja])
)


 
Pbix download
 
 
thanks for all
1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @maximum ;
This is normal, according to the data in your table CEILING(value, 1) function you are rounding up;
However, your formula is [Média Diária de Qtde Produto Vendido SSS]*SELECTEDVALUE.
where SELECTEDVALUE(ParamDiasEstoque[DiasAbastecerEstoque]) = 10; so the result of each row is shown in the figure; However, the totals are also rounded up according to the total of [Média Diária de Qtde Produto Vendido SSS]*10

vyalanwumsft_0-1664243829886.png
Or you could change it

SugestaoReposicao Teste = 
VAR diasParametros = SELECTEDVALUE(ParamDiasEstoque[DiasAbastecerEstoque])
// VAR qtdVendidaSSS = [Soma Qtde Produto Vendido SSS]
// VAR dias = DISTINCTCOUNT('dCalendário'[Data])
// VAR divisao = CEILING(DIVIDE(qtdVendidaSSS,dias,0),1)
// VAR qtdParam = ROUNDUP(divisao,0) * diasParametros
return
// CALCULATE(
//     CEILING(diasParametros * [Média Diária de Qtde Produto Vendido SSS],1),
//     ALLSELECTED(dClientes[Nome loja])
// )
sumx(SUMMARIZE('dProdutos',[Descricao + Ean],"1",

CALCULATE(
    CEILING(diasParametros * [Média Diária de Qtde Produto Vendido SSS],1),
    ALLSELECTED(dClientes[Nome loja])
)),[1])

The final show:

vyalanwumsft_1-1664245183253.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
maximum
New Member

Hey Dude, thank you so much for your help. 

v-yalanwu-msft
Community Support
Community Support

Hi, @maximum ;
This is normal, according to the data in your table CEILING(value, 1) function you are rounding up;
However, your formula is [Média Diária de Qtde Produto Vendido SSS]*SELECTEDVALUE.
where SELECTEDVALUE(ParamDiasEstoque[DiasAbastecerEstoque]) = 10; so the result of each row is shown in the figure; However, the totals are also rounded up according to the total of [Média Diária de Qtde Produto Vendido SSS]*10

vyalanwumsft_0-1664243829886.png
Or you could change it

SugestaoReposicao Teste = 
VAR diasParametros = SELECTEDVALUE(ParamDiasEstoque[DiasAbastecerEstoque])
// VAR qtdVendidaSSS = [Soma Qtde Produto Vendido SSS]
// VAR dias = DISTINCTCOUNT('dCalendário'[Data])
// VAR divisao = CEILING(DIVIDE(qtdVendidaSSS,dias,0),1)
// VAR qtdParam = ROUNDUP(divisao,0) * diasParametros
return
// CALCULATE(
//     CEILING(diasParametros * [Média Diária de Qtde Produto Vendido SSS],1),
//     ALLSELECTED(dClientes[Nome loja])
// )
sumx(SUMMARIZE('dProdutos',[Descricao + Ean],"1",

CALCULATE(
    CEILING(diasParametros * [Média Diária de Qtde Produto Vendido SSS],1),
    ALLSELECTED(dClientes[Nome loja])
)),[1])

The final show:

vyalanwumsft_1-1664245183253.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.