Forum Discussion
Calculate function with filtering by date not working
Sales_YTD = VAR SD = [StartDate] VAR ED = [EndDate] VAR Result = CALCULATE (
SUM(GMS_View[Value]); FILTER ( ALLEXCEPT (
GMS_View; GMS_View[Brand.Brand Level 01]; GMS_View[Country.Country Level 01]); GMS_View[date] >= SD && GMS_View[date] <= ED )
) RETURN Result
Hi Ale
I would suggest you modify the ED like below.If it is not your case,please share the .pbix file for us to test. You can upload it to OneDrive and post the link here. Do mask sensitive data before uploading.
Sales_YTD = VAR SD = [StartDate] VAR ED = SELECTEDVALUE(Table[Slicer]) VAR Result = CALCULATE ( SUM(GMS_View[Value]); FILTER ( ALLEXCEPT ( GMS_View; GMS_View[Brand.Brand Level 01]; GMS_View[Country.Country Level 01]); GMS_View[date] >= SD && GMS_View[date] <= ED ) ) RETURN ResultRegards,
Cherie
3 Replies
- Greg_DecklerCommunity Champion
Hmm, that's odd. Sample data would help tremendously. See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008 - v-cherch-msftMicrosoft Employee
Hi Ale
I would suggest you modify the ED like below.If it is not your case,please share the .pbix file for us to test. You can upload it to OneDrive and post the link here. Do mask sensitive data before uploading.
Sales_YTD = VAR SD = [StartDate] VAR ED = SELECTEDVALUE(Table[Slicer]) VAR Result = CALCULATE ( SUM(GMS_View[Value]); FILTER ( ALLEXCEPT ( GMS_View; GMS_View[Brand.Brand Level 01]; GMS_View[Country.Country Level 01]); GMS_View[date] >= SD && GMS_View[date] <= ED ) ) RETURN ResultRegards,
Cherie
- v-cherch-msftMicrosoft Employee
Hi Ale
Could you tell me if your problem has been solved? If it is,kindly mark the helpful answer as a solution if you feel that makes sense. Welcome to share your own solution. More people will benefit from here.
Regards,
Cherie