Forum Discussion
Anonymous
8 years agoNot applicable
Power BI Desktop (DirectQuery) Sum Measure Based on Dynamic Dates
Hi DAX Experts, Hope you could help me again or hear your suggestions (I am still learning PowerBI). Using DirectQuery, how to get the sum of a measure based on two dynamic dates like getting...
- Anonymous8 years ago
Hi Anonymous,
>>But I need to only get 3,588 (the budget from 3 January to 19 January).
In my opinion, you can use 'lookupvalue' function to find out current date, then use it as condition to filter on calculate formula.
MTDBudget = IF(MAX(YTDBudget[CurMonFlag])= 1,CALCULATE( SUM(YTDBudget[SalesBudget] ),FILTER(ALLSELECTED(YTDBudget),'YTDBudget'[CurMonFlag] = 1 && [BudgetDate] <=LOOKUPVALUE(YTDBudget[BudgetDate],YTDBudget[CurDayFlag],1) )))
Regards,
Xiaoxin Sheng
Anonymous
8 years agoNot applicable
Hi Anonymous,
What type of data you stored in business day column? If it contains whole number, I don't think datevalue can convert them to date formula.
Can you please share more detail content and some sample data/pbix file for test?
Regards,
Xiaoxin Sheng