cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
zibster Regular Visitor
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
Highlighted
Super User
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])

 

 

 

 

View solution in original post

2 REPLIES 2
Highlighted
Super User
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])

 

 

 

 

View solution in original post

zibster Regular Visitor
Regular Visitor

Re: Distinct column based on another column

Thanks that woks !!!!

Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 141 members 1,611 guests
Please welcome our newest community members: