Forum Discussion

RJSuttlemyre's avatar
RJSuttlemyre
Frequent Visitor
3 years ago
Solved

How to count rows based on two names

Hi all -- a little help if you could...   I have a table called "Event Groups" with two columns.    One column has a column called "IdFlight", which is a nominal variable (number of a airline fli...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi RJSuttlemyre ,

     

    According to your description, here are my steps you can follow as a solution.

    (1) This is my test data.  

    (2) We can create a measure. 

    Measure = var a=SUMMARIZE('Event Groups','Event Groups'[IdFlight],"Count",COUNTROWS(FILTER('Event Groups',[IdFlight] in VALUES('Event Groups'[IdFlight])&&[Name] in {"RNAV Approach","UNSTABLE APPROACH - DB"})))
    return SUMX(FILTER(a,[IdFlight] in VALUES('Event Groups'[IdFlight])),[Count])

    (3) Then the result is as follows.

     

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

     

    Best Regards,

    Neeko Tang

    If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly.