cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ArquimedesP
Helper I
Helper I

Distincount wiht slicer

Hi guys, i have a two tables: 

 

Entradas (Which has "Año de Ingreso" Column)

Desembolsos (Which has "Nro_Operaciones" and "Año Desembolso" column)

 

I need a measure that do Distintcount of "Nro_Operaciones" base on a slicer "Año de Ingreso"

 

I did this measure: 

Operaciones Desembolsadas por Año =
VAR _A= SELECTEDVALUE(Entradas[Año Ingreso])
RETURN
CALCULATE(DISTINCTCOUNT(VW_BT_Desembolsos[Nro_Operacion]),FILTER(ALL(VW_BT_Desembolsos),VW_BT_Desembolsos[Año Desembolso]=_A))
 
It works well if I select only one year in my slicer, but when i have two years selected or none the result is blank.
 
What am i missing??
 
Thansk!
1 ACCEPTED SOLUTION
ArquimedesP
Helper I
Helper I

I found the reason, Measure will be: 

 

Operaciones Desembolsadas por Año =
VAR _A= VALUES(Entradas[Año Ingreso])
RETURN
CALCULATE(DISTINCTCOUNT(VW_BT_Desembolsos[Nro_Operacion]),FILTER(ALL(VW_BT_Desembolsos),VW_BT_Desembolsos[Año Desembolso]IN _A))

View solution in original post

1 REPLY 1
ArquimedesP
Helper I
Helper I

I found the reason, Measure will be: 

 

Operaciones Desembolsadas por Año =
VAR _A= VALUES(Entradas[Año Ingreso])
RETURN
CALCULATE(DISTINCTCOUNT(VW_BT_Desembolsos[Nro_Operacion]),FILTER(ALL(VW_BT_Desembolsos),VW_BT_Desembolsos[Año Desembolso]IN _A))

Helpful resources

Announcements
Power BI Show Episode 10 Recap

The Power BI Community Show

Watch the playback when Amit Chandak, a Power BI Super User, demos how to use Field Parameters to make reports more dynamic.

Power BI Dev Camp Session 26

New Date - Check it Out!

Mark your calendars and join us on Thursday, October 6 at 11a PDT for a great session with Ted Pattison!

Health and Life Sciences Power BI User Group

Health and Life Sciences Power BI User Group

Power BI specialists at Microsoft have created a community user group where customers in the provider, payor, pharma, health solutions, and life science industries can collaborate.

Ignite 2022

What's Next at Microsoft Ignite 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Top Solution Authors
Top Kudoed Authors