cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerKoen
Frequent Visitor

sum filter not working correctly

Hi there, need some help with my formula. I want to extract (based on selectedvalue of slicer) the LATEST date AND LATEST uploadtime and sum the values of those items

 

Current situation:

 

AssetID DealID Marketvalue Effectivedate Uploadtime Enddate Type
1 1 10 01/01/2019 02/01/2019 09:00 office
2 1 10 01/01/2019 02/01/2019 09:00 house
1 1 15 01/01/2019 05/01/2019 09:00 office
1 1 20 01/02/2019 02/02/2019 09:00 office
2 1 20 01/02/2019 02/02/2019 09:00 house
1 1 25 01/02/2019 05/02/2019 09:00 office
1 1 30 01/02/2019 05/02/2019 10:00 01/03/2019 10:00 office

My formula's

Market value totaal = 

VAR Year = YEAR(SELECTEDVALUE(Assets[Effectivedate]))
VAR Month = MONTH(SELECTEDVALUE(Assets[Effectivedate]))
VAR Day = DAY(SELECTEDVALUE(Assets[Effectivedate]))
Var Selectedday = DATE (Year; Month; Day)

var effectiveLAST = 

CALCULATE(  MAX(Assets[EffectiveDate]); FILTER ( allexcept(Assets; Assets[AssetID]; Assets[DealID]); Assets[EffectiveDate] <= Selectedday))

VAR uploadLAST = 

CALCULATE(  MAX(Assets[Uploadtime]); FILTER ( allexcept(Assets; Assets[AssetID]; Assets[DealID]); Assets[EffectiveDate] <= Selectedday))

var som = CALCULATE( SUM( Assets[Marketvalue]) ; Assets[Effectivedate] = effectivelaatste; Assets[Uploadtime] = uploadlaatste )

Return

CALCULATE( SUM( Assets[Marketvalue]);  Assets[Effectivedate] = effectiveLAST; Assets[Uploadtime] = uploadLAST)

This gives me the correct values behind the rows, but not the total / graph for each type.

I tried allexcept (assets; type) and summarize but not working.

 

graph.pngCan anyone help me?

 

Gladly here from you. 

 

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi PowerKoen, 

It seems that you want to get grant total based on current result, right? If so, you could create measure like below, then use this in table or chart

Measure 2 = IF(HASONEVALUE(Assets[AssetID]), [Market value totaal], SUMX(ALLSELECTED(Assets),[Market value totaal]))

349.PNG

Best Regards,
Zoe Zhi

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

1 REPLY 1
dax
Community Support
Community Support

Hi PowerKoen, 

It seems that you want to get grant total based on current result, right? If so, you could create measure like below, then use this in table or chart

Measure 2 = IF(HASONEVALUE(Assets[AssetID]), [Market value totaal], SUMX(ALLSELECTED(Assets),[Market value totaal]))

349.PNG

Best Regards,
Zoe Zhi

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

Helpful resources

Announcements
collabdays lisbon

CollabDays Lisbon - 26 November 2022

Sessions include practical, hands-on experience that will help you take the next step in your career and know-how.

Difinity Conference

Difinity Conference 2022

Difinity is the largest Microsoft Data, AI, Power BI, Power Platform and Business Applications Conference in New Zealand.

European Share Point Conference

European Share Point Conference

This conference returns live and in-person in Copenhagen this 28 November-01 December with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Microsoft 365 Conference â__ December 6-8, 2022

Microsoft 365 Conference - 06-08 December

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.