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
Anonymous
Not applicable

Rollup the date based on condition

Hello Everyone

I would like to achieve the rollup for each Category -  with the max date where color is not equal to red
Below is the sample data - 

Rid123_0-1633381430263.png


I am getting the wrong highlighted dates - (it should filter out the date where it is red)

Rid123_2-1633381633190.png

Result Expected For highlighted date- 
A - 11/18/2021
B - 10/11/2021


Thanks in advance. Would really appreciate the help.

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

Try this:

 

Lastest Date =
IF (
    HASONEVALUE ( Table1[Color] ),
    MAX ( Table1[Date] ),
    CALCULATE ( MAX ( Table1[Date] ), Table1[Color] <> "Red" )
)

View solution in original post

4 REPLIES 4
AlexisOlson
Super User
Super User

Try this:

 

Lastest Date =
IF (
    HASONEVALUE ( Table1[Color] ),
    MAX ( Table1[Date] ),
    CALCULATE ( MAX ( Table1[Date] ), Table1[Color] <> "Red" )
)
Anonymous
Not applicable

@AlexisOlson - 

Using the above measure you suggested is taking longer to process the data. 

Is there a way to use any other formula instead? 
I also learnt that the Hasonevalue takes longer time to process the query. 

See if this works any faster:

Lastest Date =
IF (
    HASONEVALUE ( Table1[Color] ),
    MAX ( Table1[Date] ),
    CALCULATE ( MAX ( Table1[Date] ), KEEPFILTERS ( Table1[Color] <> "Red" ) )
)
Anonymous
Not applicable

Thanks a lot. This is so helpful.

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.

Top Solution Authors