Forum Discussion
Masure Sum based on string and date column
Hello All,
thank you for replying. I tried the formula but unfortunatelly it seems that the date filter is not working properly. The measure is calculating for all of the dates.
In the link file from which screenshot was taken : https://easyupload.io/l12f1a
Hi Anonymous ,
Try to create calendar table and relate it with the Time period then adjust your Last week for the calendar table.
Check the PBIX file attach and tell me if this is the expected result.
- Anonymous6 years agoNot applicable
Hello,
thank you for your answer. Unfortunatelly this is not what i need to achieve.
In a nutshell, what i need is a measure that will sum "Published" column when KeyFigure column is "Published Indicator" for last week from History (Date when added to database = History), Time Period = MAX ).
In the file you shared the measure is summing not only for the last week but also for past weeks:
- MFelix6 years ago
Super User
Hi Anonymous ,
Try the following code:
LWPublishedv1 = CALCULATE ( SUM ( Table1[Published] ); FILTER ( 'Table1'; 'Table1'[Key Figure] = "Published Indicator" && ( CALCULATE ( MAX ( Table1[Time Period Date] ); ALL ( 'CAlendar'[Date] ) ) = MAX ( Table1[Time Period Date] ) ) = TRUE () && 'Table1'[Date when data was loaded to database] = "History" ) )- Anonymous6 years agoNot applicable
Hello Miguel,
Power Bi is flagging multiple errors due to semicolons