Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have two tables, one with orders, and one with the items on the order. They are linked by a separate key:
In the example I have:
I am looking for a measure that will give me that last output. i.e. a distinct count of the order, where the distinct count of the item = 1
I tried below but it is gving me a zero output
CALCULATE( DISTINCTCOUNTNOBLANK(Table1[Order]) ,
FILTER( RELATEDTABLE(Table2), DISTINCTCOUNTNOBLANK(Table2[Item])=1) )
Solved! Go to Solution.
@dapperscavenger , Assume two table are related with each other, try a measure like
CALCULATE( Countx(filter(Summarize( Table2, Table1[Order] , "_1" , DISTINCTCOUNTNOBLANK(Table2[Item])),[_1] =1 ),[Order]))
or
CALCULATE( Countx(filter(Summarize( Table1, Table1[Order] , "_1" , DISTINCTCOUNTNOBLANK(Table2[Item])),[_1] =1 ),[Order]))
@dapperscavenger , Assume two table are related with each other, try a measure like
CALCULATE( Countx(filter(Summarize( Table2, Table1[Order] , "_1" , DISTINCTCOUNTNOBLANK(Table2[Item])),[_1] =1 ),[Order]))
or
CALCULATE( Countx(filter(Summarize( Table1, Table1[Order] , "_1" , DISTINCTCOUNTNOBLANK(Table2[Item])),[_1] =1 ),[Order]))
Worked great! Thank you!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
58 | |
56 | |
56 | |
38 | |
29 |
User | Count |
---|---|
75 | |
62 | |
45 | |
40 | |
39 |