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
I have a DAX measure that displays Customer Status as "Sem Crescimento", "Com Crescimento", "Sem Histórico", and "Sem Compra". Currently, this measure dynamically characterizes a customer based on their Gross Sales (through DAX) and does not exist as a characterization within a table.
I need a solution to transform this DAX measure into a slicer, where the user can select one of the 4 options in the filter and view in a table visual only the customers that match the status according to the selected filter.
Below is the DAX formula for Customer Status and the two Gross Sales measures that compose this measure:
Status Cliente =
VAR VendasAtual = [Venda Bruta]
VAR VendasAnterior = [Venda Bruta AA]
RETURN IF(ISBLANK(VendasAtual) = FALSE() && ISBLANK(VendasAnterior) = FALSE() && VendasAtual > VendasAnterior, "COM CRESCIMENTO", IF(VendasAtual = 0 && VendasAnterior > 0, "SEM COMPRA", IF(VendasAtual > 0 && VendasAnterior > 0 && VendasAtual < VendasAnterior, "SEM CRESCIMENTO", IF(VendasAnterior = 0 && VendasAtual > 0, "SEM HISTÓRICO", BLANK()))))
Venda Bruta =
CALCULATE( SUMX( FILTER( 'tabela_venda', 'tabela_venda'[ITEM_COM_RECUSA] = "Não"), 'tabela_venda'[VL_LIQUIDO] ) ) + CALCULATE( SUMX( FILTER( 'tabela_venda', 'tabela_venda'[ITEM_COM_RECUSA] = "Sim"), 'tabela_venda'[VL_CAN] ) )
Venda Bruta AnoAnterior =
VAR ColecaoAnterior = [Coleção Anterior]
RETURN CALCULATE([Venda Bruta], ALL(dim_chave[CHAVE_COMERCIAL]), dim_chave[CHAVE_COMERCIAL] = ColecaoAnterior )
Coleção Anterior =
VAR Atual = [Coleção Atual]
VAR Chave = LEFT(Atual, 2) VAR AnoAnterior = RIGHT(Atual, 4) - 1
RETURN Chave & " " & AnoAnterior
Coleção Atual = SELECTEDVALUE(dim_metas[CHAVE_COMERCIAL])
Thank you in advance for your help!
Power BI does not support that. You need to bring your own reference table with the expected category values, and then you can base your measure on that table.
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 |
---|---|
23 | |
16 | |
12 | |
9 | |
7 |
User | Count |
---|---|
38 | |
32 | |
28 | |
12 | |
11 |