Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hello, PowerBI Gurus,
So I have a simple measure that computes a forecast for the selected period. When I use a card visualization and apply a filter to it it works just fine. However, if I need to use the measure in other calculations, then the filter which I applied to the card gets lost.
My question is: How do I incorporate the filter directly into the measure? (I need a filter that filters out just the chosen year)
Here is my measure:
Forecast 2019 = CALCULATE(SUM(MANAGERS[Plan 2019])/12, ALL())*DISTINCTCOUNT(SALES[Year-Month])
Thank you in advance,
PowerBI beginner.
Hi @zenonsbelskiss ,
You may change the measure like DAX below, which uses ALLSELECTED function to catch the filter.
Forecast 2019 =
CALCULATE ( SUM ( MANAGERS[Plan 2019] ) / 12, ALLSELECTED ( MANAGERS ) )
* CALCULATE ( DISTINCTCOUNT ( SALES[Year-Month] ), ALLSELECTED ( SALES ) )
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@zenonsbelskiss
I don't have enough information about your model, try this measure if it can be used. I supposed you have Dates table
Forecast 2019 =
VAR __YEAR = SELECTEDVALUE(DATES[Year]) RETURN
CALCULATE(
SUM(MANAGERS[Plan 2019])/12,
DATES[Year] <> __YEAR
)
*
DISTINCTCOUNT(SALES[Year-Month])
________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
User | Count |
---|---|
122 | |
69 | |
67 | |
58 | |
52 |
User | Count |
---|---|
187 | |
94 | |
67 | |
63 | |
54 |