cancel
Showing results for
Did you mean:
Highlighted
Helper III

## Distinct column based on another column

Hi, I know that this is basic but I don't use dax that often and I am stuck, I need to get distinct count of dates for every store_id. In first column, I have all the dates and 2nd column Store_id.

When i use the following i get only distinct dates

Day Count:=DISTINCTCOUNT(Table_Query_from_td_prd_qd5[scan_dt])

Z

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III

## Re: Distinct column based on another column

Hi @zibster

If I've understood correctly what you need, your measure is fine. You just need to place it in a matrix visual to see the result for every store. Try this:

1. Place a matrix visual in your report and set the column Table_Query_from_td_prd_qd5[Store_id] in the rows of the matrix

2. Set the measure whose code you already show in values of the matrix visual:

`Day Count = DISTINCTCOUNT(Table_Query_from_td_prd_qd5[scan_dt])`

2 REPLIES 2
Highlighted
Super User III

## Re: Distinct column based on another column

Hi @zibster

If I've understood correctly what you need, your measure is fine. You just need to place it in a matrix visual to see the result for every store. Try this:

1. Place a matrix visual in your report and set the column Table_Query_from_td_prd_qd5[Store_id] in the rows of the matrix

2. Set the measure whose code you already show in values of the matrix visual:

`Day Count = DISTINCTCOUNT(Table_Query_from_td_prd_qd5[scan_dt])`

Highlighted
Helper III

## Re: Distinct column based on another column

Thanks that woks !!!!

Announcements

#### August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

#### Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

#### Community Summit Australia – Join Online!

Be a part of the leading Microsoft Business Applications digital event, curated for the APAC community.

Top Solution Authors
Top Kudoed Authors