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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Distinct Count in new Column show blank result in table

Hi All, I have a distinct count "New column"

distinctcount__ = CALCULATE(DISTINCTCOUNT(HistoricalBO[Index])). It should count all index rows that in 2020, but it shows blanks(see the picture below)
Capture.PNG
I tried to use new measure. it worked. But I need to be new column for further calculation.
 
Thank you all.
1 ACCEPTED SOLUTION

Hi @Anonymous ,

Please delete that calculated column and try to recreate a new calculated column with below formula:

distinctcount__ =
CALCULATE (
    DISTINCTCOUNT ( HistoricalBO[Index] ),
    FILTER (
        'HistoricalBO',
        'HistoricalBO'[Year] = EARLIER ( 'HistoricalBO'[Year] )
    )
)

distinctcount.JPG

If the above one still get blank values, please provide some sample data in your model(exclude sensitive data). Thank you.

Best Regards

Rena

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

View solution in original post

6 REPLIES 6
camargos88
Community Champion
Community Champion

@Anonymous ,

 

Can you provide more examples of your dataset ?



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Anonymous
Not applicable

@camargos88 
Three columns. year, item , index( as a unique row reference)

I want to get how many items in a year. so I counted the index in a new column.

distinctcount__ = CALCULATE(DISTINCTCOUNT(HistoricalBO[Index]))
Year     Distinctcount
2020  _nothing show_

@Anonymous ,

 

It maybe be necessary take a look at your pbix file to check the modeling, your measure should work.



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Anonymous
Not applicable

@camargos88  only one table , 3 columns, no data model applied.  no filter applied in the page. 

Capture.PNG

Hi @Anonymous ,

Please delete that calculated column and try to recreate a new calculated column with below formula:

distinctcount__ =
CALCULATE (
    DISTINCTCOUNT ( HistoricalBO[Index] ),
    FILTER (
        'HistoricalBO',
        'HistoricalBO'[Year] = EARLIER ( 'HistoricalBO'[Year] )
    )
)

distinctcount.JPG

If the above one still get blank values, please provide some sample data in your model(exclude sensitive data). Thank you.

Best Regards

Rena

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

@Anonymous ,

 

Can you share this pbix ?



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.