Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
sontt
Resolver I
Resolver I

Calculate and Userelationship functions!

Hi everyone,

 

I have a table like that:

 

Createdatebillnumberstatusshipdate
27/01/2018SO1Done28/01/2018
27/01/2018SO2Wait28/01/2018
30/01/2018SO3Done01/02/2018
05/02/2018SO4Done06/02/2018
06/02/2018SO5Done06/02/2018

 

and relationship: 

 

I want calculate how many bills was "Done" by shipdate, but measures not give me same results:

 

 

 

My measures:

 

 

count bills ship done:= CALCULATE(DISTINCTCOUNT(data[billnumber]),data[status]="Done",USERELATIONSHIP(data[shipdate],'date'[date]))

 

count bills ship done_v2:= CALCULATE(DISTINCTCOUNT(data[billnumber]),FILTER(data,data[status]="Done"),USERELATIONSHIP(data[shipdate],'date'[date]))

 

 

count bills ship done_v3:=CALCULATE([count bills done],USERELATIONSHIP(data[shipdate],'date'[date]))

count bills done:=CALCULATE(DISTINCTCOUNT(data[billnumber]),FILTER(data,data[status]="Done"))

 

 

Measure count bills ship done_v2 return incorrect result but i dont understand why.

Please tell me why count bills ship done_v3 returns correct result but count bills ship done_v2 didnt

 

Sorry about my English.

 

Thanks in advance!

2 REPLIES 2
v-yulgu-msft
Employee
Employee

 Hi @sontt,

 

Based on my test, both count bills ship done_v3 and count bills ship done_v2 return correct result.

1.PNG

 

In above image, [Month] is a calculated column added in 'data' table.

Month = MONTH(data[shipdate])

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Sorry bro, my active relationship is date[CreateDate] - date[Date]. Can u help me check my file here please:

https://drive.google.com/open?id=1CbusjEwpv-wh0WXr4Iz3xBZDTZ4Jwfdv

 

Thank you so much

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.