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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
NilR
Post Patron
Post Patron

Sum(Values) based on the MIN of Date for each User_ID

In the below calculated table I have some highligthed IDs with more than one Engage_Dt and I only want to get their first/Min Engag_Date to sum([Value]) . how can I filter that?

 

 

 

Table = 
VAR Min_Date = "202207"
VAR Max_Date = "202306"
VAR _gpnb = "xxxx"
VAR _ACTIVE_CNSR_ID = GROUPBY(FILTER(‘Table’,([ENR_DT]>= Min_Date && [ENR_DT]<= Max_Date) && ‘Table’[GP_NB]=_gpnb && [_ID] <> "0" ),’Table’[_ID])

Return
 ADDCOLUMNS(SUMMARIZE( 
         FILTER(‘Table’, [_ID] IN _ACTIVE_CNSR_ID && ‘Table’[ENGAGED_DT] >= Min_Date && ‘Table’[ENGAGED_DT] <= MAX_Date 
        && (‘Table’[ENR_DT]>= Min_Date && ‘Table’[ENR_DT]<= Max_Date) 
        && ‘Table’[GP_NB]=_gpnb ),
         ‘Table’[_ID],  ‘Table’[ENGAGED_DT]),
        "__VALUE",  CALCULATE( IF(MIN(‘Table’[ENGAGED_DT]) , SUMX(‘Table’,[_VALUE]),0)))

 

 

 

_IDENGAGED_DT_Value
112500879882023025
162500308552023025
212501950392023025
25001801072023025
412500662512022118
512501715012022118
512501715012022127
512501715012023043
562500639992023025
575001350482023043
600003412932023024
600003412992023025
600003413122023024
62503145382023025
62504068792023025
650003139822022127
75002525252023061
825000347772023025
825003593142023052
875003567382023061
925000926512023025

 

Below Final Expected result :

NilR_0-1691760832925.png

 

1 ACCEPTED SOLUTION

Corrected for now.

Ashish_Mathur_0-1692056888852.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

8 REPLIES 8
Ashish_Mathur
Super User
Super User

Hi,

Please find attached the PBI file.

Hope this helps.

Ashish_Mathur_0-1691984211999.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

This is exactly correct but the total returns wrong!

Corrected for now.

Ashish_Mathur_0-1692056888852.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @NilR ,

Please have a try.

Create a measure.

Measure = var _1=MINX(FILTER(ALL('Table'),'Table'[_ID]=SELECTEDVALUE('Table'[_ID])),'Table'[ENGAGED_DT])
return 
IF(MAX('Table'[ENGAGED_DT])=_1,1,BLANK())

vrongtiepmsft_0-1691977228658.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

ToddChitt
Super User
Super User

Create a new table with this statement:

My Table = SUMMARIZE('Table', 'Table'[_ID], "Min ENGAGE_DT", MIN('Table'[ENGAGE_DT] )

Now add a column that concatenates _ID and ENGAGE_DT from this table and the base table. Join on that column.

That should be a one-to-one relationship.

Now add a column = RELATED('Table'[Value])




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





Thank You! I am new to this and could not follow your direction and figure it out! 😔

ToddChitt
Super User
Super User

For the one row you have highlighted, what result are you expecting? Can you give us a few samples?




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





Thank you! below picture should be the finial:

NilR_0-1691760779388.png

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors