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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
luciano1903
Frequent Visitor

Contagem veículos e clientes

Pessoal bom dia!

Tenho uma situação, em que preciso saber a quantidade de veículo e volume carregado em cada cliente. Porem as vezes 1 veiculo carrega 5 CRTs, nao relatório fincando 5 linhas(CRTs diferentes). Cada CRT é um exportador/Cliente.

Preciso criar uma medida para cada situacao, para saber a quantidade de veiculo e volume de veiculos carregado em cada cliente, notar que a mesma placa carrega em lugares diferentes.

Segue exemplo:

 

luciano1903_0-1711386607732.png

 

Desde ja agradeco pela ajuda.

1 ACCEPTED SOLUTION
v-tangjie-msft
Community Support
Community Support

Hi @luciano1903 ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1711419190224.png

(2) We can create measures.

the number of vehicles =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[VEICULO] ),
    FILTER ( ALLSELECTED ( 'Table' ), 'Table'[CLIENTE] = MAX ( 'Table'[CLIENTE] ) )
)
the volume of vehicles loaded at each customer =
COUNTROWS (
    FILTER ( ALLSELECTED ( 'Table' ), 'Table'[CLIENTE] = MAX ( 'Table'[CLIENTE] ) )
)

(3) Then the result is as follows.

vtangjiemsft_1-1711419280229.png

Best Regards,

Neeko Tang

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
luciano1903
Frequent Visitor

@v-tangjie-msft 

 

Muito Obrigado pela ajuda.

v-tangjie-msft
Community Support
Community Support

Hi @luciano1903 ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1711419190224.png

(2) We can create measures.

the number of vehicles =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[VEICULO] ),
    FILTER ( ALLSELECTED ( 'Table' ), 'Table'[CLIENTE] = MAX ( 'Table'[CLIENTE] ) )
)
the volume of vehicles loaded at each customer =
COUNTROWS (
    FILTER ( ALLSELECTED ( 'Table' ), 'Table'[CLIENTE] = MAX ( 'Table'[CLIENTE] ) )
)

(3) Then the result is as follows.

vtangjiemsft_1-1711419280229.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.