Forum Discussion
exe_binary
1 year agoFrequent Visitor
Problem with Counting rows
Hello foks, I have a data like call_no part_no date_lt country 1234567 aa123 5/15/2023 le 1234567 bb456 5/21/2023 le 1234567 cc789 5/26/2023 le 456789 qq987 4/12/2024 ...
Kedar_Pande
1 year agoSuper User
MaxDate =
VAR SelectedCallNo = SELECTEDVALUE('YourTable'[call_no])
VAR SelectedPartNo = SELECTEDVALUE('YourTable'[part_no])
RETURN
CALCULATE(
MAX('YourTable'[date_lt]),
FILTER(
'YourTable',
(ISBLANK(SelectedPartNo) || 'YourTable'[part_no] = SelectedPartNo)
&& 'YourTable'[call_no] = IF(ISBLANK(SelectedCallNo), 'YourTable'[call_no], SelectedCallNo)
)
)
FlagCount =
CALCULATE(
COUNTROWS('YourTable'),
'YourTable'[date_lt] = [MaxDate],
'YourTable'[DynamicLastRecordFlag] = 1
)
If this helped, a Kudos 👍 or Solution mark would be great!🎉
Cheers,
Kedar Pande
Connect on LinkedIn
- exe_binary1 year agoFrequent Visitor
Kedar_Pandefor 'FlagCount' it returns me an error: A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table filter expression. This is not allowed.
- Kedar_Pande1 year agoSuper User
Modified:
FlagCount =
CALCULATE(
COUNTROWS('YourTable'),
FILTER(
'YourTable',
'YourTable'[date_lt] = [MaxDate] &&
'YourTable'[DynamicLastRecordFlag] = 1
)
)- exe_binary1 year agoFrequent Visitor
Still the same problem, but your FlagCount doesn't work well neither in Table not Matrix.
If you can see from the image below'DynamicLastRecord' works fine in a Table and I need to figure out how to distinct count it and add that measure in Matrix, so for call_no = 456789 is should return just 1 in May. I do not need SUM. Not sure if you understand me.