Forum Discussion
MEASURE TO FILTER?
- Anonymous2 years ago
Hi,383man
I am glad to help you.According to your description, you want to calculate the number of users, if there is a record with the suffix “BKR”, then directly return its “CUST COUNTS” value.
But sometimes there are no breakers, if there are no breakers, then calculate all the non-repeated numbers and add them up 327+117+180+....
If my understanding is correct, you can refer to my following test
First I recreated two tables and de-duplicated the duplicate data in them
like this:Then I created three measures
Total CUST COUNTS BKR = CALCULATE(SUM('Table_2'[CUST COUNTS]),FILTER('Table_2',RIGHT('Table_2'[NAME CORRECTED], 3) = "BKR"&&'Table_2'[Feeder]=MAX('Table_2'[Feeder]) ) )Total CUST COUNTS NotBKR = CALCULATE(SUM('Table_2'[CUST COUNTS]),FILTER('Table_2',RIGHT('Table_2'[NAME CORRECTED], 3) <>"BKR"&&'Table_2'[Feeder]=MAX('Table_2'[Feeder]) ) )M_result = IF( COUNTROWS( CALCULATETABLE('Table_2', FILTER('Table_2', RIGHT('Table_2'[NAME CORRECTED], 3) = "BKR") ) ) > 0, [Total CUST COUNTS BKR], [Total CUST COUNTS NotBKR] )The final test result is as follows:
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
that is super clever and would work, if i could remove duplicates, however, i need the list to show duplicates as there is also a column called "Risk Areas" which is the main filter criteria. and there may be multiple risk areas with the same device, and also multiple "action types" that have multipe risk areas on them... it's kind of duplicating to the max, but when I filter the data down to just show "action type" of "PSPS Action" in a table, and a total sum card at the top filtered to the same, but that sum card is double counting based on the previous ask. i attached the full screen grab of the table to show it's complexity.