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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
RustyD
Frequent Visitor

Distinctcount shows duplicated lines but the total is correct

hi, 

as in the subject.  I have a counter of PO numbers and I use DISTINCTCOUNT for that. It was working but recently we appended the PO table with other containing different attributes/columns. 

Now the #PO  shows the correct total  but displays empty (like duplicated rows) rows of that attitional table even if no column from that table is added to the report. 

 

without Distinct #PO count:

RustyD_1-1727331426054.png

 

With #PO count  but without column from additional table,  counts empty line - not expected result. 

RustyD_0-1727331286085.png

 

With #PO count but also with column from additional table (IR)  so this is correct behaviour:

RustyD_4-1727331944653.png

 

How can I get rid of the empty line from the 2nd screenshot ? 

Thanks for any hints. 

 

1 ACCEPTED SOLUTION
RustyD
Frequent Visitor

hi again,

but actualy you gave an idea.

I have created an identifier column which rows come from PO table and which from others and then I used it as filter in the calculate formula:

#PO =
CALCULATE(
DISTINCTCOUNT('Purchase Orders'[PO number]),
'Purchase Orders'[Table_Identifier]="Purchase Order")

View solution in original post

3 REPLIES 3
RustyD
Frequent Visitor

hi again,

but actualy you gave an idea.

I have created an identifier column which rows come from PO table and which from others and then I used it as filter in the calculate formula:

#PO =
CALCULATE(
DISTINCTCOUNT('Purchase Orders'[PO number]),
'Purchase Orders'[Table_Identifier]="Purchase Order")
RustyD
Frequent Visitor

hi @bhanu_gautam  thanks for reply. 

Unfortunatelly it is not working and giving same result as previous measure. 

Also I forgot to stress is out that all rows are now in 1 table (after append) . Also there might be more columns with empty rows so it would not be efficient to include all of them in formula. 

bhanu_gautam
Super User
Super User

@RustyD , You can try to create a measure to filter out the empty rows. For example, you can create a measure that counts the distinct PO numbers only if there is a corresponding value in the additional table

 

DistinctPOCount =
CALCULATE(
DISTINCTCOUNT('POTable'[PONumber]),
NOT(ISBLANK('AdditionalTable'[SomeColumn]))
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.