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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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