March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Olá
Preciso somar a quantidade das vendas que estão na tabela esquerda, porem com criterios diferente para cada supervisor da tabela direita. Como fazer isso dinamicamente no power bi?
Tem que ser dinamico, pois os supervisores podem mudar sua supervisão.
Planilha aqui
Veja na tabela direita onde a formula SOMASES tem criterios diferentes para os supervisores:
Solved! Go to Solution.
Hi @Vilmar
Thanks for reaching out to us.
You can try this,
Soma Qtde =
var _s= MIN(List[Supervisor])
return
SWITCH(TRUE(),
_s="Ajani"||_s="Pratik",CALCULATE(SUM('Table'[Qtd]),FILTER(ALL('Table'),'Table'[Regiao]=MIN(List[Regiao]) && 'Table'[Categoria]=MIN(List[Categoria]))),
_s="Uehudah"||_s="Edison",CALCULATE(SUM('Table'[Qtd]),FILTER(ALL('Table'),'Table'[Tipo]=MIN(List[Tipo]))),
_s="Mihoko",CALCULATE(SUM('Table'[Qtd]),FILTER(ALL('Table'),'Table'[Categoria]=MIN(List[Categoria]))),
_s="Ruthie",CALCULATE(SUM('Table'[Qtd]),FILTER(ALL('Table'),'Table'[Meio]=MIN(List[Meio]))))
result
If you have many supervisors, then you can add a column such like below, then use column=1 or 2 to determine which type of formula to choose
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi @Vilmar
Thanks for reaching out to us.
You can try this,
Soma Qtde =
var _s= MIN(List[Supervisor])
return
SWITCH(TRUE(),
_s="Ajani"||_s="Pratik",CALCULATE(SUM('Table'[Qtd]),FILTER(ALL('Table'),'Table'[Regiao]=MIN(List[Regiao]) && 'Table'[Categoria]=MIN(List[Categoria]))),
_s="Uehudah"||_s="Edison",CALCULATE(SUM('Table'[Qtd]),FILTER(ALL('Table'),'Table'[Tipo]=MIN(List[Tipo]))),
_s="Mihoko",CALCULATE(SUM('Table'[Qtd]),FILTER(ALL('Table'),'Table'[Categoria]=MIN(List[Categoria]))),
_s="Ruthie",CALCULATE(SUM('Table'[Qtd]),FILTER(ALL('Table'),'Table'[Meio]=MIN(List[Meio]))))
result
If you have many supervisors, then you can add a column such like below, then use column=1 or 2 to determine which type of formula to choose
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
@v-xiaotang obrigado por responder.
Seria quase isso que fez, mas tinha que ser algo mais dinâmico, pois terei vários supervisores com combinações diferentes, e criar vários valores constantes a ser correspondido no switch, será muito trabalhoso.
Mais uma vez, obrigado!
Hi @Vilmar
Thanks for your reply. In this scenario you can follow the second method I introduced. Since different combinations have different calculation formulas, these are unavoidable and need to be set manually in the measure.
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
89 | |
84 | |
70 | |
51 |
User | Count |
---|---|
206 | |
146 | |
97 | |
79 | |
69 |