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
HUAM
Helper II
Helper II

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.

HUAM_0-1644801457184.png

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
1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @HUAM ;

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:

vyalanwumsft_0-1645079645567.png

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.

View solution in original post

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi, @HUAM ;

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:

vyalanwumsft_0-1645079645567.png

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.

Ashish_Mathur
Super User
Super User

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.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.