Forum Discussion
binayjethwa
3 years agoHelper V
Calculate total rows based on slicer selection
Hi All, I have the following table where I have list of Item. To calculate weight , i need to count rows of table which is 14 and divide it by 100 as mentioned below. Also I have a slicer for...
FreemanZ
3 years agoSuper User
Hi binayjethwa
Not sure if i fully get you, then try
Measure =
VAR _bl =SELECTEDVALUE(TableName[ BLs/subsidiaries])
VAR _count =
COUNTROWS(
FILTER(
ALL(TableName),
TableName[BLs/subsidiaries] = _bl
)
)
RETURN
DVIDE(100, _count)binayjethwa
3 years agoHelper V
FreemanZ The above measure is working fine with single selection , but if i do multiple selections i see weight is calculated sepatately. even if i do multiple selections , for example 2 BL/subsidaries , it should take total count of selected BL/s and divide by 100 as a whole. can you please suggest how we can achieve this.
- FreemanZ3 years agoSuper User
hi binayjethwa
try like:
Measure =VAR _count = COUNTROWS(TableName)RETURN DIVIDE(100, _count)it worked like this:if it doesn't work, please consider expand your data sample to fully represent the issue and expectation. And continue @me, if furthere suggest is needed.