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

countrows with filter issue

Hi Expert,

 

would appreciate if someone can shed some light on this problem I'm struggling with.

 

Background

i have two tables 

1. daily services - train daily services info

2. vds - crew shift info

 

i build a bridge table to link daily services & vds by using UniqueKey which is merged from two columns 

in daily services is operating date & TT_TDN

in VDS is shiftdate &TripID

 

i have a measure to calculate the number of first departure train services 

First Departure = CALCULATE(COUNTROWS('COMPASS VU_DailyServices'),FILTER('COMPASS VU_DailyServices','COMPASS VU_DailyServices'[First Departure]=1))

 

i also have a test first departure measure

Test.FD = CALCULATE(COUNTROWS('v_VDS_Compass_2'),FILTER('COMPASS VU_DailyServices','COMPASS VU_DailyServices'[First Departure]=1))

 

this two DAX supposed return to the same result, because each train crew run one service, 

but i receive two different result, only first departure gives me right number.

 

Yiling_0-1603838331916.png

but when i add columns - depot from vds table, the first departure from each depot = test first departure, the number at each depot largely decreased.

 

Yiling_1-1603838420791.png

 

here's my pbix link for test

 

https://1drv.ms/u/s!AjpB2wk5YDY3hwObjTB22ZdetGwb?e=rK1Bb9

 

thanks 🙂 

 

 

 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @Yiling,

I think this should be related to the relationship between two tables, measure will apply filter effects through related fields.
How did your table field links? (relationship mapping and direction)

You can also take a look at the following link to know more about relationship mapping.

What is the Direction of Relationship in Power BI? 

Create and manage relationships in Power BI Desktop 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @Yiling,

I think this should be related to the relationship between two tables, measure will apply filter effects through related fields.
How did your table field links? (relationship mapping and direction)

You can also take a look at the following link to know more about relationship mapping.

What is the Direction of Relationship in Power BI? 

Create and manage relationships in Power BI Desktop 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.