Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Simple calculation

Hi, all.

 

I wonder how to make a measure value in this case.

I want to count the rowss of tablet A with filter about A,B,C.
I want to calculate by applying a filter for the state of B and the version of C.
The three table Relations are as follows.

I tried likt this but no work

#test =
CALCULATE(COUNTROWS('A'),
   'A'[A_type] = "A_type" &&
   'A'[A_status] = "A_status" &&
   'B'[B_status] = "B_status" &&
   'C'[C_type = "C_type")
 
I think it isn't work beacause of many to many realtion.
How to calculation in this case?
 
Thank you
  • Hi, Anonymous ;

    I noticed your last post, is it similar to this one, based on the data from the previous post, I created the following formula:

    diff = DATEDIFF(MAX('Table'[coupon_usedate]),MAX('Table2'[lastlinkdate]),DAY)
    count = COUNTX(FILTER( 'Table2',[diff]<=30&&[diff]>=0),[lastlinkdate])

     The final output is shown below:

    If not right ,could you share a simple file and share the result what you want to output?


    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Hi,

    You should not have many to many relationships at all.  You should use/create a bridge table instead.  Share some data to work with along with a description of your question and show the expected result.

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Community Support

    Hi, Anonymous ;

    I noticed your last post, is it similar to this one, based on the data from the previous post, I created the following formula:

    diff = DATEDIFF(MAX('Table'[coupon_usedate]),MAX('Table2'[lastlinkdate]),DAY)
    count = COUNTX(FILTER( 'Table2',[diff]<=30&&[diff]>=0),[lastlinkdate])

     The final output is shown below:

    If not right ,could you share a simple file and share the result what you want to output?


    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.