March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
Hello,
Im trying to count only the distinct values in a column called "Order ID" but only when certain criteria is present in other columns,
the criteria: count distincy values in Order ID column , only where system column is "OCI" and the type column is "Notification" and origina column is "AB" and the date colum (which shows month and year e.g October 2023) is February 2024.
Any help would be greatly apreciated
Solved! Go to Solution.
DistinctOrderCount =
CALCULATE( COUNTROWS( VALUES('YourTable'[Order ID]) ),
'YourTable'[system] = "OCI",
'YourTable'[type] = "Notification",
'YourTable'[original] = "AB",
FORMAT('YourTable'[date_column], "YYYYMM") = "202402" )
Hi @Earl40 ,
First of all, many thanks to @olgad for your very quick and effective replies, I'll provide a different dax formula below for your reference.
DistinctCountConditional =
CALCULATE(
DISTINCTCOUNT('YourTableName'[Order ID]),
'YourTableName'[system] = "OCI",
'YourTableName'[type] = "Notification",
'YourTableName'[origina] = "AB",
FORMAT('YourTableName'[date], "MMMM YYYY") = "February 2024"
)
Please replace `'YourTableName'` with the actual name of your table.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Earl40 ,
First of all, many thanks to @olgad for your very quick and effective replies, I'll provide a different dax formula below for your reference.
DistinctCountConditional =
CALCULATE(
DISTINCTCOUNT('YourTableName'[Order ID]),
'YourTableName'[system] = "OCI",
'YourTableName'[type] = "Notification",
'YourTableName'[origina] = "AB",
FORMAT('YourTableName'[date], "MMMM YYYY") = "February 2024"
)
Please replace `'YourTableName'` with the actual name of your table.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
DistinctOrderCount =
CALCULATE( COUNTROWS( VALUES('YourTable'[Order ID]) ),
'YourTable'[system] = "OCI",
'YourTable'[type] = "Notification",
'YourTable'[original] = "AB",
FORMAT('YourTable'[date_column], "YYYYMM") = "202402" )
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
89 | |
84 | |
70 | |
51 |
User | Count |
---|---|
206 | |
143 | |
97 | |
79 | |
68 |