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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Josué
Frequent Visitor

Ocultar campos de segmentação sem dados

Olá a todos,

 

Estou com um problema ao segmentar dados. Meu modelo de dados é composto por 3 tabelas básicas. Criei 2 dimensões que conectam essa tabela, mês e funcionário. E essas 2 dimensões também são segmentações em meu relatório.

O problema é filtrar os dados. Por exemplo, seleciono o funcionário A na segmentação, mas ele só tem dados em 2 meses, no entanto todos os meses são exibidos. 

Existe uma forma do filtro de meses exibir apenas os meses em que o funcionário A possui dados?

No Excel basta ocultar os itens sem dados, mas não existe uma opção como essa para o Power BI. 

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

Hi @Josué ,

 

I think you want to filter month slicer based on DimMonth table when you select employee slicer based on DimEmployee table.

Here are two workarounds to achieve your goal.

My Sample:

RicoZhou_3-1653472114416.png

1. I think the relationship between data table and DimMonth table is many to one with single direction. 

RicoZhou_0-1653471988455.png

You can change direction to both.

RicoZhou_1-1653472076082.png

Result:

RicoZhou_2-1653472086536.png

2. You can keep the single direction and create a measure to filter Month slicer.

Measure = 
VAR _MONTHLIST = CALCULATETABLE(VALUES('Table'[Month]))
RETURN
IF(MAX('DimMonth'[Month]) IN _MONTHLIST,1,0)

Add this measure into visual level filter in Month slicer and set it to show items when value =1.

Result is as below.

RicoZhou_4-1653472201722.png

 

 

Best Regards,
Rico Zhou

 

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

3 REPLIES 3
v-rzhou-msft
Community Support
Community Support

Hi @Josué ,

 

I think you want to filter month slicer based on DimMonth table when you select employee slicer based on DimEmployee table.

Here are two workarounds to achieve your goal.

My Sample:

RicoZhou_3-1653472114416.png

1. I think the relationship between data table and DimMonth table is many to one with single direction. 

RicoZhou_0-1653471988455.png

You can change direction to both.

RicoZhou_1-1653472076082.png

Result:

RicoZhou_2-1653472086536.png

2. You can keep the single direction and create a measure to filter Month slicer.

Measure = 
VAR _MONTHLIST = CALCULATETABLE(VALUES('Table'[Month]))
RETURN
IF(MAX('DimMonth'[Month]) IN _MONTHLIST,1,0)

Add this measure into visual level filter in Month slicer and set it to show items when value =1.

Result is as below.

RicoZhou_4-1653472201722.png

 

 

Best Regards,
Rico Zhou

 

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

 

 

 

Obrigado @v-rzhou-msft a solução que acabou dando certo foi a utilzação de medidas nos filtros de visuais.

jcalheir
Solution Supplier
Solution Supplier

Olá,

 

No powerquery podes filtrar os meses que não tem dados em qualquer coluna (como no excel), dessa maneira esses dados não serão carregados para o modelo (report).

 

jcalheir_0-1652950155532.png

 

Espero ter ajudado.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.