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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.