Forum Discussion
morgtd30
Helper I
6 years agoHelp with filtering out measure
I have a slicer option that is "6/1/2020". When de-selected I need it to turn both measures blank. JunProj = CALCULATE(SUM(Projections[Amount]), Projections[Month] = "6/1/2020") I have another ...
- 6 years ago
I was able to solve the problem with the following formula:
Apr Projection =TOTALYTD([AprProj], 'Date'[Date])+IF(COUNTROWS(FILTER(MonthTable,MonthTable[ProjectionMonth] = "4/1/2020")) >0,TOTALYTD(CALCULATE(SUM(Opportunity[Amount]),Opportunity[StageName] = "Closed Won",Opportunity[CloseDate] < DATE(2020,4,1)) , 'Date'[Date]),BLANK())
AllisonKennedy
Community Champion
6 years agoCalculate context transition is tricky, so you'll get the Jun value no matter what is selected in slicer.
Try: JunProj = SUMX(FILTER(Projections, Projections[Month] = "6/1/2020"), Projections[Amount])
What is it you're actually wanting to achieve though? I question why a slicer selection should render a measure to be blank, and why you're creating measures with such specific dates hard coded into them? Can you provide dummy data of your sample model and explain what you need?
Try: JunProj = SUMX(FILTER(Projections, Projections[Month] = "6/1/2020"), Projections[Amount])
What is it you're actually wanting to achieve though? I question why a slicer selection should render a measure to be blank, and why you're creating measures with such specific dates hard coded into them? Can you provide dummy data of your sample model and explain what you need?
morgtd30
Helper I
6 years agoHere's what the line graph looks like. I'm building a way to compare YTD projections for any given current or historical month. The 6/1/2020 is one of many filters to remove the lines off the graph as necessary. The green line is the current YTD. It works great other than those amounts that still show up even after the month is filtered out. It causes the tool-tip to fill with bad data.