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
Estou tentando criar uma medida no Power BI para exibir uma lista de clientes que estão associados a um segmento específico, com base na seleção de um cliente em um slicer.
Estou usando a seguinte fórmula DAX:
No entanto, a fórmula não está retornando todos os clientes do segmento, mas apenas um único cliente.
Alguém pode me ajudar a ajustar essa fórmula para que, ao selecionar um cliente, eu possa ver todos os clientes do mesmo segmento?
Solved! Go to Solution.
Hi @Spaik ,
I created some data:
As far as I know, when the slicer and visual use the same field, when the slicer selects a value, the visual will also only show the data for the value selected by the slicer, and you will need to create a sliced table without a join relationship
Here are the steps you can follow:
1. Create calculated table – slicer table.
Table =
DISTINCT('Table 23-24'[Nome Fantasia])
2. Create measure.
Flag =
VAR ClienteSelecionado =
SELECTEDVALUE ( 'Table'[Nome Fantasia])
VAR SegmentacaoDoCliente =
CALCULATE (
MAX ( 'Table 23-24'[SEGMENTO] ),
'Table 23-24'[Nome Fantasia] = ClienteSelecionado
)
VAR Test=
SELECTCOLUMNS(FILTER(ALL('Table 23-24'),'Table 23-24'[Nome Fantasia]=MAX('Table 23-24'[Nome Fantasia])),"Nome Cliente",[SEGMENTO])
RETURN
IF(
SegmentacaoDoCliente in Test,1,0)
3. Place [Flag]in Filters, set is=1, apply filter.
4. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @Spaik ,
I created some data:
As far as I know, when the slicer and visual use the same field, when the slicer selects a value, the visual will also only show the data for the value selected by the slicer, and you will need to create a sliced table without a join relationship
Here are the steps you can follow:
1. Create calculated table – slicer table.
Table =
DISTINCT('Table 23-24'[Nome Fantasia])
2. Create measure.
Flag =
VAR ClienteSelecionado =
SELECTEDVALUE ( 'Table'[Nome Fantasia])
VAR SegmentacaoDoCliente =
CALCULATE (
MAX ( 'Table 23-24'[SEGMENTO] ),
'Table 23-24'[Nome Fantasia] = ClienteSelecionado
)
VAR Test=
SELECTCOLUMNS(FILTER(ALL('Table 23-24'),'Table 23-24'[Nome Fantasia]=MAX('Table 23-24'[Nome Fantasia])),"Nome Cliente",[SEGMENTO])
RETURN
IF(
SegmentacaoDoCliente in Test,1,0)
3. Place [Flag]in Filters, set is=1, apply filter.
4. Result:
Best Regards,
Liu Yang
If this post helps, then 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 |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |