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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

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
Anonymous
Not applicable

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

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

Anonymous
Not applicable

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

@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
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors