Forum Discussion

feralvarez994's avatar
feralvarez994
Helper II
4 years ago
Solved

Help with model

Hi everyone! I have an issue i think with the model, but for sure you gonna know better than me

 

The thing is, i want to create a visualization (horizontal bar chart) with the number of bookings (_Contar autos) by seller (column VE_APELLIDO from VENDE table)), i get the number of bookings with this DAX:

 

_Contar autos = VAR autoosCALCULATE ( COUNT ( AUTOS[AT_COAUTO] ) )
RETURN IF ( ISBLANK ( autoos ), 0, autoos )
  

 

 

I have a table in the same dashboard that has the detail with many columns from Autos table and the Seller (VE_APELLIDO), but when i try to make an horizontal bar chart, this happens

 

Can someone help me? I think its a model thing, thank you all!

  • Hi feralvarez994 

    try to CROSSFILTER the relationship between AUTOS table and the BUCFIN table to "BOTH"

    _Contar autos = VAR autoosCALCULATE ( COUNT ( AUTOS[AT_COAUTO] ), CROSSFILTER ( AUTOS[AT_COAUTO], BUCFIN[BUC_COAUTO], BOTH ))
    RETURN IF ( ISBLANK ( autoos ), 0, autoos )

     

2 Replies

  • tamerj1's avatar
    tamerj1
    Community Champion

    Hi feralvarez994 

    try to CROSSFILTER the relationship between AUTOS table and the BUCFIN table to "BOTH"

    _Contar autos = VAR autoosCALCULATE ( COUNT ( AUTOS[AT_COAUTO] ), CROSSFILTER ( AUTOS[AT_COAUTO], BUCFIN[BUC_COAUTO], BOTH ))
    RETURN IF ( ISBLANK ( autoos ), 0, autoos )