cancel
Showing results for
Search instead for
Did you mean:
Regular Visitor

## 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])

Please help

Z

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

## 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
Super User

## 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])`

Regular Visitor

## Re: Distinct column based on another column

Thanks that woks !!!!

## Helpful resources

Announcements

#### Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

#### Community News & Announcements

Get your latest community news and announcements.

#### Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

#### Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Top Kudoed Authors
Users Online
Currently online: 357 members 3,416 guests
Recent signins:
Please welcome our newest community members: