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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Counting function in calculated column instead of measure

Hello There,

 

Is it possible to use 'CountDistinct' function or any alternate way to count number of unique entries in a calculated column.

I mean in 'New Column' instead of 'New Measure'

 

Thanks in Advance.

6 REPLIES 6
ianbarker
Helper III
Helper III

Do you have an example of what you wish to acheive?

Anonymous
Not applicable

column = distinctcount(Dimcustomer[CustomerRank])

instead of

Measure = distinctcount(Dimcustomer[CustomerRank])

I still don't follow why you would want to do that.

There's nothing to stop you doing it, but you'd end up with the same value against each record.

Anonymous
Not applicable

buddy actually i need total of the count column.

I have a calculation like 'Column/total count'

for this um trying to create a column with count and then its total as total count and then i will perform the above calculation.

um unable to create a calculation using both measure and column cus um in DirectQuery mode.

Is it clear now or u want me to elaborate it bit more..??

if it is clear then is there any better way to do that...!!

Ah, ok... So your using Direct Query? In that case, I understand your issue. 

As you already know, you can't currently create a DAX measures in Power BI when using the Direct Query connection.

What is your data source? 

 

My personal opinion is, until the ability to add DAX in Direct Query becomes available, Direct Query shouldn't really be used unless your data source is a multi-dimensional or tabular cube.

If you're not using either of these, then unless somebody has an alternative suggestion, I'd look to not using Direct Query.

Anonymous
Not applicable

Hmmm K.

Thanks for your response @ianbarkerSmiley Happy

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.