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.
I have a Sales table with "Sale-Value" column and time table, with "Year" & "Month" columns.
I need a measure to get the sum of "Sale-Value", in the current Year and Month.
Appreciate and thank you for your help
Solved! Go to Solution.
You can use
This month sales =
CALCULATE (
SUM ( 'Sales'[Sale value] ),
'Date'[Year] = YEAR ( TODAY () ),
'Date'[Month] = MONTH ( TODAY () )
)
You could use REMOVEFILTERS
This month sales =
CALCULATE (
SUM ( 'Sales'[Sale value] ),
'Date'[Year] = YEAR ( TODAY () ),
'Date'[Month] = MONTH ( TODAY () ),
REMOVEFILTERS ( 'Date' )
)
Thanx,
I steel have an issue of filtering:
I have some slicers in the visuals page, which filter Year and Month.
"This month sales" is affected by the filtering.
What do I need to add to the DAX code, so the measure will not be filtered?
You could use REMOVEFILTERS
This month sales =
CALCULATE (
SUM ( 'Sales'[Sale value] ),
'Date'[Year] = YEAR ( TODAY () ),
'Date'[Month] = MONTH ( TODAY () ),
REMOVEFILTERS ( 'Date' )
)
You can use
This month sales =
CALCULATE (
SUM ( 'Sales'[Sale value] ),
'Date'[Year] = YEAR ( TODAY () ),
'Date'[Month] = MONTH ( TODAY () )
)
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 |
---|---|
97 | |
97 | |
82 | |
74 | |
66 |
User | Count |
---|---|
121 | |
105 | |
102 | |
82 | |
72 |