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
Meraki_jeet
Frequent Visitor

Distinctcount based on values in another column of same table – DAX for measure?

Hello Experts,

 

 I am new to Power BI. Could you please help me with below?  So below is my simplified table


resource_name  |  scan_date     | Scan_time     |   server selected |
   ABS                    06-06-2023     1:00:00 AM            SQL
   BCS                    06-06-2023     1:00:00 AM            SQL
   ADB                    08-06-2023     8:00:00 AM            Oracle

So here i need to find out the concurrency issue. As above you can see for resource_name "ABS" & "BCS" the scan_date, scan_time and server_selected are same. So in this scenario i have to highlight this and expecting a output like below either as measure or calculated column.


output required:
Scan_date     | Concurrent issue |
06-06-2023                2

So I have to take count of distinct resource_name which have all same details

 

Thanks in advance!!

1 ACCEPTED SOLUTION
some_bih
Super User
Super User

Hi @Meraki_jeet your measure for distinctcount should be something like: DISTINCTCOUNT(Table[ColumnName]), so as I understand from your example it should be DISTINCTCOUNT(YourTableName[resource_name]), as resource_name is only column with 2 distinct value. i hope this help.

 





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

Proud to be a Super User!






View solution in original post

2 REPLIES 2
Meraki_jeet
Frequent Visitor

Hi @some_bih , Thanks alot! I was able to get the above requirement with below formula,

Calculate(Distinctcount(TableName[resource_name]), ALLEXPECT(TableName, TableName[scan_date], TableName[Scan_time], TableName[server selected]))

some_bih
Super User
Super User

Hi @Meraki_jeet your measure for distinctcount should be something like: DISTINCTCOUNT(Table[ColumnName]), so as I understand from your example it should be DISTINCTCOUNT(YourTableName[resource_name]), as resource_name is only column with 2 distinct value. i hope this help.

 





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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.