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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
mottamatheus835
Frequent Visitor

Condition calcution between two tables

OLÁ,

Tenho o seguinte caso:

Tabela vendas:

- Meta Alcançável (é a o quanto da meta já deveria ter sido alcançado -- Meta / Dias úteis * Dias Passados)

- Dias Úteis  (Medida calculada a partir de uma tabela data)

- Dias passados (Medida -- Dias úteis - Dias úteis restantes )

 

Tabela Lojas:

- Número da loja (chave da relação entre as tabelas)

- Abre final de semana (Sim ou Não)

Preciso fazer um cálculo da medida META ALCANÇÁVEL, mas se caso um valor específico de outra tabela esteja sendo selecionado, o cálculo no visual leve em consideração outra condição de dias, isso porque nem todas as lojas abrem somente em dias úteis, mas sim todos os dias.

Por exemplo, tenho um gráfico de barras e no valor da META ALCANÇÁVEL da LOJA X, que não abre final de semana e possui na tabela Lojas o campo ABRE FINAL DE SEMANA como Sim, o ideal seria em vez dos dias úteis o total de dias do mês atual e nos dias passados atuais do relatório. 

META ALCANÇÁVEL = META / TOTAL DE DIAS DO MÊS ATUAL * DIAS PASSADOS ATUAIS 

 

 

Seguem os dados em Link:

https://drive.google.com/drive/folders/1ohkzA_ocKKAbymZNCXtJ2q3nupCjXBo9?usp=sharing 

Exemplo de um resultado esperado:

No caso da Loja 5 uma das que abrem todos os dias, o cálculo seria:

Meta - R$350.000

Dias Úteis - 31 (Nesse caso são os totais de dias do mês de outubro)

Dias Passados - 24 (dia dessa mensagem, mas no cálculo seria uma função Today, provavelmente)

 

META ALCANÇÁVEL = META / TOTAL DE DIAS DO MÊS ATUAL * DIAS PASSADOS ATUAIS 

META ALCANÇÁVEL = 350.000/ 31 * 24

META ALCANÇÁVEL = 270967,74

 

OBS: Já me indicaram usar isfiltered, mas ele apenas me deixa ver uma coluna inteira, precisa que fosse possível checar se um valor específico da coluna está sendo filtrado

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

Hi @mottamatheus835 ,

 

Based on your description, I created several new measures
Displays the workday count when not filtered

vjialluomsft_0-1668763983855.png

 

When filtering, counts based on the type of different stores

vjialluomsft_1-1668763983868.png

 

Further calculations can be made based on these measures, If this is not what you need, please describe further

 

Best Regards,

Gallen Luo

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

1 REPLY 1
v-jialluo-msft
Community Support
Community Support

Hi @mottamatheus835 ,

 

Based on your description, I created several new measures
Displays the workday count when not filtered

vjialluomsft_0-1668763983855.png

 

When filtering, counts based on the type of different stores

vjialluomsft_1-1668763983868.png

 

Further calculations can be made based on these measures, If this is not what you need, please describe further

 

Best Regards,

Gallen Luo

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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.