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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register 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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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