Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Create a new table based on filters

I have and e-learning data with duplicates across the different columns just like this

First NameLast NameCourse titleStatusCompletion date
JamesPaulCourse ARegistered 
JamesPaulCourse ACompleted1/2/18
JamesPaulCourse BRegistered 
JamesPaulCourse BCompleted3/5/18
AnnePeterCourse ARegistered 
AnnePeterCourse BRegistered 
AnnePeterCourse CRegistered 
AnnePeterCourse CCompleted5/8/20

 

I want to create a new table with columns: [first name], [Last name], [course], [Status] using a DAX expression.

Each person would have one unique row for the completion status of each course.

If a course has been completed, I only want that row on the new table (filtering based on the completion date not blank and if no completion date exist, the status is marked "Incomplete")

For Instance:

First NameLast NameCourse titleStatus
JamesPaulCourse ACompleted
JamesPaulCourse BCompleted
AnnePeterCourse AIncomplete
AnnePeterCourse BIncomplete
AnnePeterCourse CCompleted
  • Anonymous's avatar
    Anonymous
    5 years ago

    Thanks for your response.

    I was able to work around it using power query, relationships and DAX. The data was more complex than I explained.

6 Replies

  • Anonymous , one of the two ways

     

    summarize(filter(Table, Table[Status] ="Completed"  ), [first name], [Last name], [course], [Status] )

     

    or

     

    calculatetable(Table, filter(Table, Table[Status] ="Completed"  ))

    • Shadow_BN515's avatar
      Shadow_BN515
      New Member

      This worked fantasic, just what I was looking for. Thanks for the help

    • StefD's avatar
      StefD
      Frequent Visitor

      Works for me very well too. Is there an opition to have 2 ctriterias listed? as .... {"mm" , "xx"}  ... is not working form me. Thanks in advance.

      • StefD's avatar
        StefD
        Frequent Visitor

        SOLVED like this:

        summarize(filter(Table, Table[Column] = "abc" || Table[Column] = "123") )
  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks for your response.

    I was able to work around it using power query, relationships and DAX. The data was more complex than I explained.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous 

    Create the following Table:

    Table 2 = summarize('Table', [first name], [Last name], [Course title],[Completion date],"Status",IF([Completion date]=BLANK(),"Incomplete","Complete"))

     

     

    Paul Zheng _ Community Support Team
    If this post helps, please Accept it as the solution to help the other members find it more quickly.