Forum Discussion
Summing a Range Based on Serial Numbers
- Anonymous1 year ago
Hi trathman ,
Thanks for Ashish_Mathur and DataNinja777 replies and efforts.Based on your description and their suggestions, here is the sample data and MEASURE I created
To make sure slicer works, there should be no relationship between the tables
Create a measure
Total = VAR SerialStart = SELECTEDVALUE(SlicerTableA[ValueA]) * 10000 + SELECTEDVALUE(SlicerTableB[ValueB]) * 100 + SELECTEDVALUE(SlicerTableC[ValueC]) VAR SerialEnd = SELECTEDVALUE(SlicerTableA[ValueA]) * 10000 + SELECTEDVALUE('SlicerTableB'''[ValueB']) * 100 + SELECTEDVALUE('SlicerTableC'''[ValueC']) RETURN CALCULATE( SUM(BookDtl[BookAmt]), FILTER( BookDtl, BookDtl[Serial] >= SerialStart && BookDtl[Serial] <= SerialEnd ) )Final output
Best regards,
Albert HeIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi,
In Power Query, ensure that the data type of the Serial number column is number. This measure should work
Measure = calculate(SUM('BookDtl'[BookAmt]),'BookDtl'[Serial]>=min('BookDtl'[Serial])&&'BookDtl'[serial]<=max('BookDtl'[Serial]))
If this does not work, then share the download link of the PBI file and show the expected result very clearly.