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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
zibster
Helper III
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])

 

Please help

Z

1 ACCEPTED SOLUTION
AlB
Super User
Super User

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

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

 

 

 

 

Thanks that woks !!!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.