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

How to pick rows by groups with newest date in specific period of time

Hello,

 

Regarding table with data below, I would like to ask:

how I could create report table, where I could pick specifick period of time (for example 1/14/2020-1/20/2020) and then pick the newest rows regarding "Group" name? 

ProjectGroupGroup_statusDate
Mainmain_1grPassed1/11/2020
Mainmain_1grFailed1/13/2020
Mainmain_3grFailed1/14/2020
Mainmain_2grFailed1/15/2020
Mainmain_1grFailed1/16/2020
Mainmain_1grFailed1/19/2020
Syssys_1grFailed1/11/2020
Syssys_2grFailed1/13/2020
Syssys_1grPassed1/14/2020
Syssys_2grFailed1/15/2020
Syssys_2grFailed1/17/2020
v104v104_1grFailed1/14/2020
V104v104_1grPassed1/17/2020
v104v104_1grFailed1/18/2020
v20v20_1grFailed1/14/2020
v20v20_1grPassed1/20/2020
v20v20_1grFailed1/21/2020
v20v20_1grFailed1/22/2020
1 ACCEPTED SOLUTION
dustinn
Resolver I
Resolver I

Not really good at DAX but make a measure then that will serve as your table filter.

 

Measure1 =
VAR MaxDate =
CALCULATE (
MAX ( [Date] ),
ALLSELECTED ( 'Table'[Date], 'Table'[Group], 'Table'[Group_status] )
)
RETURN
CALCULATE ( MAX ( [Date] ), FILTER ( 'Table', [Date] = MaxDate ) )


i3rKGct

 

 

View solution in original post

3 REPLIES 3
dustinn
Resolver I
Resolver I

Not really good at DAX but make a measure then that will serve as your table filter.

 

Measure1 =
VAR MaxDate =
CALCULATE (
MAX ( [Date] ),
ALLSELECTED ( 'Table'[Date], 'Table'[Group], 'Table'[Group_status] )
)
RETURN
CALCULATE ( MAX ( [Date] ), FILTER ( 'Table', [Date] = MaxDate ) )


i3rKGct

 

 

Anonymous
Not applicable

Thank you, @dustinn  , your measure helped me! Only, I replaced 'Table'[Group] to 'Table'[Project].

amitchandak
Super User
Super User

create a measure like this and use in your visual

calculate(countrow(table),
	filter(summarize(table,table[Group],"_maxdt",max(table[date]),"_maxGp",max(table[Group])),
			table[Group]=[_maxGp] && max(table[date]=_maxdt)))

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

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.