Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

CalculateTable help

I need to return a calculate table with the datarows highlighted below. Basically All rows from the table where Marker =1 
The column Marker is a DAX measure . 

Report
Date
 EDW
CustomerID
 IndexRow 
Measure
 Marker
8/31/2020 0:00 3 1 0
9/30/2020 0:00 3 2 0
10/31/2020 0:00 3 3 0
11/30/2020 0:00 3 4 0
4/30/2021 0:00 3 5 1
8/31/2020 0:00 4 1 0
9/30/2020 0:00 4 2 0
10/31/2020 0:00 4 3 0
11/30/2020 0:00 4 4 0
4/30/2021 0:00 4 5 1
8/31/2020 0:00 5 1 0
9/30/2020 0:00 5 2 0
10/31/2020 0:00 5 3 0
11/30/2020 0:00 5 4 0
4/30/2021 0:00 5 5 1
8/31/2020 0:00 6 1 0
9/30/2020 0:00 6 2 0
10/31/2020 0:00 6 3 0
11/30/2020 0:00 6 4 0
4/30/2021 0:00 6 5 1

 

Please help me use CalculatetAble DAX to return a table 

Thanks in Advance.

5 Replies

  • Anonymous 

    This should work

    New Table = CALCULATETABLE ( Table , Table[Marker] = 1 )


    or this

    New Table = FILTER ( Table , Table[Marker] = 1 )
    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for your Reply Fowmy .

       

      But the CALCULATETBALE expression the way you mentioned above gives me an error 

      Not sure why ? and how to get rid of this error?
      Is this becasue IndexRow Measure is a DAX measure with zeros/ones value? 
      Please help me understand this error as well the best possible approach to achieve the desired output
      Thanks 

      • Samarth_18's avatar
        Samarth_18
        Community Champion

        HI Anonymous ,

         

        You have mentioned you need to calculatetable where marker = 1 right? So your code would be like below:-

        member_channel_new = 
        CALCULATETABLE (
            'Member channel Utilization',
            'Member channel Utilization'[marker] = 1
        )

        Thanks,

        Samarth