Forum Discussion

RaghdahIsmael's avatar
4 years ago
Solved

Using calculated Columns instead of Measures

Hello DAX team,

 

Im trying to reuse the below both measures but as calculated columns that I'm trying to create in power query as Custom column

 

1.   # Deals in Rel =  count(DealsData[dealsNbr]) 

 

2.  # Deals-orig and curr are the same =  COUNTX(filter(DealsData, DealsData[ProdOfcr – first 2 characters] = DealsData[first 2 characters]), DealsData[dealsNbr]).

 

Intially, I created the first column to do the same job of measure 1 with the DAX in the below screenshot but it gave me an error then :  

 

 

 

the reason for creating these columns instead of measures so that i can use SUM or Count with those columns , because as we know we can't view SUM or COunt with measure but we can do so with Columns as the below screenshots :

 

 

 

 

To sum up, i need your support to creat columns by wrting suitable DAX that give me the same job of the above 2 measrures (1. , 2.)

 

 

thank you,

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi RaghdahIsmael ,

     

    Add two custom column as below. Then you can SUM or Count them in report view.

    New Table looks like as below.

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

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

     

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi RaghdahIsmael ,

     

    Add two custom column as below. Then you can SUM or Count them in report view.

    New Table looks like as below.

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

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

     

    • RaghdahIsmael's avatar
      RaghdahIsmael
      Helper I

      "Rico Zhou" thank you indeed for your reponse and suggested solution much appreciated and yes it worked 🙂