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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

How to filter distinct values by other columns using Power BI DAX

Hello guys,
 
I have the data below:
 
Id     Date      Value
10195  6/4/2020  ABC
10225  19/5/2020 ABC
10257  18/6/2020 ABC
10280  20/7/2020 ABC
10280  20/7/2020 ABC
10280  20/7/2020 ABC
10280  20/7/2020 ABC
10299  30/7/2020 ABC
10299  30/7/2020 ABC
10299  30/7/2020 DEF
10299  30/7/2020 ABC
10299  30/7/2020 ABC
10299  30/7/2020 ABC
 
Using DAX in Power BI, I would like to calculate the amount of values by id and date. The result table must be like this one:
 
Id.    Date      Value
10195  6/4/2020  ABC
10225  19/5/2020 ABC
10257  18/6/2020 ABC
10280  20/7/2020 ABC
10299  30/7/2020 ABC
10299  30/7/2020 DEF
 
Thanks in advance!
 
Best regards,
Gustavo
1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

Three ways to do that (at least). 

1 - You can do it in the query editor by adding a GroupBy step in the ID column, clicking on Advanced in the Group pop up and add grouping to the other 1 or 2 columns. 

 

2 - Also in the query editor, you could add a step with Remove Duplicates and update the  Table.Distinct( ) with the list of columns to summarize by.

 

3 - You can make a DAX calculated table with

 

New Table = SUMMARIZE(Table, Table[ID], Table[Date], Table[Value])

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@Anonymous 

You cam go to Modeling Click on  New Table and paste the following code to get the result as a table:

Distinct Table = DISTINCT(Table) 

Fowmy_0-1607790088488.png

________________________

If my answer was helpful, please click Accept it as the solution to help other members find it useful

Click on the Thumbs-Up icon if you like this reply 🙂


Website YouTube  LinkedIn

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

mahoneypat
Microsoft Employee
Microsoft Employee

Three ways to do that (at least). 

1 - You can do it in the query editor by adding a GroupBy step in the ID column, clicking on Advanced in the Group pop up and add grouping to the other 1 or 2 columns. 

 

2 - Also in the query editor, you could add a step with Remove Duplicates and update the  Table.Distinct( ) with the list of columns to summarize by.

 

3 - You can make a DAX calculated table with

 

New Table = SUMMARIZE(Table, Table[ID], Table[Date], Table[Value])

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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