Forum Discussion
amre
3 years agoFrequent Visitor
Sum column values based on slicers
Hi all, I am trying to create a mesure where I need to sum only the column (Total) values which are based on the slicer filters. There are two slicers: ID (from the fact table) and a Date range (...
Anonymous
3 years agoNot applicable
Hi amre ,
Here are the steps you can follow:
1. Create calculated table.
Date_Slicer =
DISTINCT('Table'[Date])
ID_Slicer =
DISTINCT('Table'[ID])
2. Create measure.
Sum_value =
var _selectID=SELECTCOLUMNS('ID_Slicer',"ID",[ID])
var _minDate=MINX(ALLSELECTED('Date_Slicer'),[Date range])
var _maxDate=MAXX(ALLSELECTED('Date_Slicer'),[Date range])
return
SUMX(
FILTER(ALLSELECTED('Table'),
'Table'[ID] in _selectID && 'Table'[Date] >=_minDate&&'Table'[Date]<= _maxDate),[Total])
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly