Forum Discussion
Max date and value by date filter slicer (dinamic)
- 6 years ago
I got a new measure, It seems to give correct GT and correct values when view NUM_DPL. But when view by NUM_DOL and date , it does not show correct value, figuring out that
Total value = Calculate( sumx( ADDCOLUMNS( SUMMARIZE( data, data[NUM_DPL], "max_date", MAX( 'Date'[Date]), "Max_ID", max(data[NUM_DPL]) ), "_num", calculate( Max(data[VLR_SLD_TOT_CAL]), filter( (data), data[NUM_DPL]= [Max_ID] && data[DAT_REF]= ([max_date]) ) ) ) ,[_num] ) )
Anonymous , the lookupvalue dont fix my problem.
amitchandak , My version is older (Versão: 2.68.5432.841 64-bit (april de 2019)) than yours, I will need to try in home with my personal computer.
- amitchandak6 years ago
Super User
I created a calendar table joined with date and created following
Measure =var _max=maxx('Date',('Date'[Date])) ReturnCALCULATE(sum(data[VLR_SLD_TOT_CAL]),FILTER('Date','Date'[Date]=_max))- caslus6 years ago
Helper I
Unfortuly, this not work amitchandak
I this case the measure need be 374.199,59 becouse:num_dpl dat_ref VLR_SLD_TOT_CAL 30495 05/09/2019 = max dat_REF(where num_dpl = 30495) 234.031,8 15129 25/09/2019= max dat_REF(where num_dpl =15129) 140.167,79 TOTAL 374.199,59
num_dpl = 30495 have the last value in the last date (234.031,18) andnum_dpl = 30495 have the last value in the last date (234.031,18)
In your archive, if I change the date in slicer, dont show nothing
- amitchandak6 years ago
Super User
Try
Measure 3 = VAR __id = MAX ( data[NUM_DPL] ) VAR __date = CALCULATE ( MAX( data[DAT_REF]), ALLSELECTED ( data ), data[NUM_DPL] = __id ) RETURN CALCULATE ( MAX (data[VLR_SLD_TOT_CAL] ), VALUES ( data[NUM_DPL] ), data[NUM_DPL] = __id, data[DAT_REF] = __date )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 -
https://community.powerbi.com/t5/Community-Blog/Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners/ba-p/890814
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p/881739
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601