Forum Discussion

minseon's avatar
minseon
Frequent Visitor
2 years ago

Count rows using USERELATIONSHIP. but blank

Hi all
i want to count rows using different date criteria in one table

 

 

 

 

relation is like this, date - orderdate is active, date - created-date is inactive.
cnt_1 dax = DISTINCTCOUNT('3_JIG_RATIO'[ORDERDATE_SN_BIGPROC])
cnt_2 dax =
CALCULATE([cnt_1], USERELATIONSHIP('3_JIG_RATIO'[CREATED_DATE], '02_Date_Code'[Date]))

 

i filtered date using date tables' date column

and result is like below. cnt2 is black.

 

i hope can be solved

thank you

2 Replies

  • ValtteriN's avatar
    ValtteriN
    Community Champion

    Hi,

    Here is how to do this:


    Dax:

    Measure 8 = DISTINCTCOUNT('Table (15)'[value])
    userelation = CALCULATE([Measure 8],USERELATIONSHIP('Calendar'[Date],'Table (15)'[Date2]))

    End result:

     

    The logic seems to work. Now the question is why are your values blank. My guess is that the data type in your second column is wrong and the relation is broken. E.g.

     

    This will result in blanks:


     

    In short test if your data types are correct and if the relationship works.

    I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

    My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/
    • minseon's avatar
      minseon
      Frequent Visitor

      both columns are date.

      i dont kow why it doesn't work...