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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
poweruser55
Helper IV
Helper IV

Distinct count two measures

How can I count distinct numbers within measures or variables. There are two ways I can do this combine at the measures into another measure or make one measure and create variables. I have 9 different measures right now with this. 

Measure 1  = CALCULATE(
DISTINCTCOUNT( '999_Funnel'[OLI Number] ),
'999_Funnel'[FC (Flag)] = "Y",
'999_Funnel'[OLI.Status] = "Active")
Measure 2 = CALCULATE(
DISTINCTCOUNT( '999_Funnel'[OLI Number] ),
'999_Funnel'[Another (Flag)] = "Y",
'999_Funnel'[OLI.Status] = "Active")
How would I add the count of the oli numbers together so that there is no overlap between the 9 measures, here are two as an example.

I need to add all of the measure together but I do not want the OLI number to be double counted. How can I add all of these measure together so that each distinct oli number is only counted once even if it occurs in other measures.

1 REPLY 1
jdbuchanan71
Super User
Super User

@poweruser55 

You can write a totaling measure that takes into account all the flags.  || = OR in DAX so something like this.

Total Count =
CALCULATE (
    DISTINCTCOUNT ( '999_Funnel'[OLI Number] ),
    '999_Funnel'[OLI.Status] = "Active" && 
	( '999_Funnel'[FC (Flag)] = "Y" || '999_Funnel'[Another (Flag)] = "Y" )
)

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.