From the course: Power BI Data Modeling with DAX

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Create a measure with DISTINCTCOUNT

Create a measure with DISTINCTCOUNT - Power BI Tutorial

From the course: Power BI Data Modeling with DAX

Start my 1-month free trial

Create a measure with DISTINCTCOUNT

- [Instructor] There is one more DAX count function I want to show you. And that is called DISTINCTCOUNT. What DISTINCTCOUNT does is it rips down a column of data, and counts each unique value only once. For example, we have a number of stores, but I'd like to know how many of our stores had sales during a particular period of time, for example. Let's take a look at our data for sales. If I go to the stores table I can count stores, but here, I have as part of my sales data, a store key. And this shows me what store a sale was made in. Therefore if I want to know how many different stores sold something, this is a great way to find out. By going to the sales table itself, the summary of our sales transaction, and say, if in this table, a store's number shows up, then count it, and tell me how many of them there are. Let's create this measure then, in the sales table. I'm going to right click, choose new measure, and I'm going…

Contents