Forum Discussion
How to count the measure
Dear all,
I have a table name "Sheet1" like this:
| Series | No |
| F88 | 1234 |
| F88 | 1235 |
| F88 | 1236 |
| F88 | 1237 |
| F88 | 1240 |
| A25 | 3456 |
| A25 | 3457 |
| A25 | 3459 |
| A25 | 3460 |
I've used the following query to figure out, which number is missing in the sequency:
It returns to what I want to see, when I show it with table:
My question is, how can I add 1 more column for the counting of the missing number.
It should be 1 for the first row, and 2 for the second row accroding to the missing number.
Is there anyway we can count the total number missing as well, in this case is 3.
Thank you for your help and support 🙂
Hi MightyRabbit ,
You could try an additional measure something like this to count at the row level:
_noofMissing = LEN([Missing_No]) - LEN(SUBSTITUTE([Missing_No], ",", "")) + 1You could further try using the above measure within a SUMX to iterate over one of your tmp tables and sum up the total.
Pete
2 Replies
- BA_PeteSuper User
Hi MightyRabbit ,
You could try an additional measure something like this to count at the row level:
_noofMissing = LEN([Missing_No]) - LEN(SUBSTITUTE([Missing_No], ",", "")) + 1You could further try using the above measure within a SUMX to iterate over one of your tmp tables and sum up the total.
Pete
- MightyRabbitFrequent Visitor
Hi BA_Pete ,
Thank you very much, it helps 🙂 Could you please elborate how could I use the SUMX against the tmp table, I have above, it seems that it only take the exisiting table "Sheet1" value only.
Thanks,