Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I am creating a measure to sum dollars by month:
MonthlySum=CALCULATE(SUM('FileYTD'[Sales]),FILTER('FileYTD','FileYTD'[Month]=SELECTEDVALUE('FileYTD'[Month])))
Need to add Month as a filter and allow the user the ability to select multiple months or just one month. SELECTEDVALUE only works on one selected month. Any suggestions of how to change the measure to SUM on any number of selected months (or all months, or 3 months based, or whatever months the user selects)?
ALLSELECTED does not work either. Any thoughts or ideas would be appreciated. Thank you!
Solved! Go to Solution.
@luvagoldenk9 , first of all if you are selecting month from same table you do not need to add that to filter it should work
CALCULATE(SUM('FileYTD'[Sales]))
Above should filter from table and related tables
even if you need a filter then
MonthlySum=
var _tab = summarize(allselected('FileYTD') , 'FileYTD'[Month])
return
CALCULATE(SUM('FileYTD'[Sales]),FILTER('FileYTD','FileYTD'[Month] in _tab ))
@luvagoldenk9 , first of all if you are selecting month from same table you do not need to add that to filter it should work
CALCULATE(SUM('FileYTD'[Sales]))
Above should filter from table and related tables
even if you need a filter then
MonthlySum=
var _tab = summarize(allselected('FileYTD') , 'FileYTD'[Month])
return
CALCULATE(SUM('FileYTD'[Sales]),FILTER('FileYTD','FileYTD'[Month] in _tab ))
Thank you amitchandak!
The second version you suggested in your response above worked like a champ. Really do appreciate your assistance and help!!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
84 | |
67 | |
60 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |