Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
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.
User | Count |
---|---|
11 | |
9 | |
8 | |
7 | |
5 |
User | Count |
---|---|
24 | |
16 | |
15 | |
10 | |
7 |