Forum Discussion
Count with filter
- 3 years ago
I solved the problem by duplicating the "journey" column, then grouping it and finally adding a new calculated column in the original table using a Lookupvalue.
Hi Anonymous ,
unfortunately, it doesn't yield the result I want to achieve.
Somehow, I am unable to upload files, so I uploaded images of my data and the result from your measure.
table in excelresult in power bi
I want to create a delta, which is simply the difference between # of journeys and # of journeys back.
In my pbix file, Frankfurt - Hamburg is counted 2 times and Hamburg - Frankfurt is counted 8 times.
So, the first row should look like this:
| Journey | # journeys | journey back | # journeys back | delta |
| Frankfurt - Hamburg | 2 | Hamburg - Frankfurt | 8 | -6 |
Any other idea how I can achieve this result?
Appreciate your effort!
Hi User2 ,
If your table can present this one-to-one correspondence, then it is easy to do the calculations you want.
just create a measure to calculate,like this
value = SUM('Table'[number of Journey ])-SUM('Table'[number of back])
Since the calculation is for the same row, it may be can't meet your needs when there is no correspondence between journey and journey back.
Best regards,
Community Support Team Selina zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly