Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Multiplying column as percentage

Trying to create a new column with a DAX expression to calcuate department miles.
 
I currrently have the total sum of miles, the sum of miles for each department, and the percentage of each
charge from the total chage for each department.
 
I would like to multiply Cost% by the TotalMiles. I'm not sure how to proceed.
 
Miles = ( [Cost%] * [TotalMiles] )
 
Thanks.
 
Ryan
 

 

  • Anonymous Well, if the table you are showing is a data table in the data model, then it will be:

     

    Miles = ( [Cost%] * [TotalMiles] )

     

    If that is a visual table and those are measures then it would be:

     

    Miles = ( [Cost%] * [TotalMiles] )

     

    In this case Miles is a measure

     

    If it is a table visual and you are using default aggregations for columns, then your Miles measure would be something like:

     

    Miles = ( MAX([Cost%]) * SUM([TotalMiles]) )

     

    Without knowing more details, hard to say.

1 Reply

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    Anonymous Well, if the table you are showing is a data table in the data model, then it will be:

     

    Miles = ( [Cost%] * [TotalMiles] )

     

    If that is a visual table and those are measures then it would be:

     

    Miles = ( [Cost%] * [TotalMiles] )

     

    In this case Miles is a measure

     

    If it is a table visual and you are using default aggregations for columns, then your Miles measure would be something like:

     

    Miles = ( MAX([Cost%]) * SUM([TotalMiles]) )

     

    Without knowing more details, hard to say.