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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
dolevh
Helper II
Helper II

Distinct of Categories names and Date

Hi, 

 

I have 2 columns from other tables of categories names and date.

 

Example: 

Table1 [Date]Table2 [Categories names]
1/1/2021Sport
1/2/2021Sport
1/3/2021News
1/4/2021News
1/5/2021Computers

 

  • I'm looking for a DAX that will bring me this table 
Table1 [Date]Table2 [Categories names]
1/1/2021Sport
1/3/2021News
1/5/2021Computers

 

Thanks for everyone!

 

2 ACCEPTED SOLUTIONS
v-zhangti
Community Support
Community Support

Hi, @dolevh 

 

You say that the two columns interact with each other, and I have a date column in Table2 by default.

vzhangti_0-1635905173967.png

Measure =
CALCULATE (
    MIN ( Table2[Date] ),
    FILTER (
        ALL ( Table2 ),
        Table2[Categories names] = MAX ( Table2[Categories names] )
    )
)

vzhangti_1-1635905263260.png

If I don't understand correctly please correct me and tell me what the interrelationship between the two columns is like, thank you.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more.

View solution in original post

Hi, @dolevh 

 

Measure =
IF (
    CALCULATE (
        MIN ( 'Table'[Date] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Categories name] = MAX ( 'Table'[Categories name] )
        )
    )
        < DATE ( 2021, 5, 1 ),
    BLANK (),
    MIN ( 'Table'[Date] )
)

vzhangti_0-1636342099461.png

 

If there are other questions please start a new thread. Thank you!

 

Best Regards,

Charlotte Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

6 REPLIES 6
v-zhangti
Community Support
Community Support

Hi, @dolevh 

 

You say that the two columns interact with each other, and I have a date column in Table2 by default.

vzhangti_0-1635905173967.png

Measure =
CALCULATE (
    MIN ( Table2[Date] ),
    FILTER (
        ALL ( Table2 ),
        Table2[Categories names] = MAX ( Table2[Categories names] )
    )
)

vzhangti_1-1635905263260.png

If I don't understand correctly please correct me and tell me what the interrelationship between the two columns is like, thank you.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more.

Thanks a lot, it's working!   

I want to add a condition for example: 

DateCategories name
01/01/2021Sport
01/02/2021 Sport
01/07/2021 Sport
01/08/2021 Sport
01/01/2021News
01/02/2021News
01/07/2021News
01/05/2021Computers
01/06/2021Computers
01/07/2021Computers
01/09/2021Food
01/10/2021Food
01/11/2021Food
 
If I am looking for categories names from 01/05/2021 its will be:
 
DateCategories name
01/05/2021Computers
01/09/2021 Food
  
how it will be working in your DAX?  
 
Thank you.

Hi, @dolevh 

 

Measure =
IF (
    CALCULATE (
        MIN ( 'Table'[Date] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Categories name] = MAX ( 'Table'[Categories name] )
        )
    )
        < DATE ( 2021, 5, 1 ),
    BLANK (),
    MIN ( 'Table'[Date] )
)

vzhangti_0-1636342099461.png

 

If there are other questions please start a new thread. Thank you!

 

Best Regards,

Charlotte Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Thank you!

Fowmy
Super User
Super User

@dolevh 

Not sure if you have the Date and the Category columns are in one table already. Please try the following new table.

Table New = 
ADDCOLUMNS(
    VALUES('Table-06'[Categories names]),
    "Date", CALCULATE( MIN('Table-06'[Date]))
)

 

Fowmy_0-1635682186814.png

 

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

It's still not working 😞 

dolevh_0-1635682661801.png

The columns from tables are different but there are interactions between them. 

@Fowmy 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.