Forum Discussion

PeteSil's avatar
PeteSil
Frequent Visitor
3 years ago
Solved

Assigning a Measure to a Specific Row in a Matrix

Hello,

 

I created a measure to take the sum of a projects cost & multiply it by 6% as that is the tax cost. So I have the below:

 

TaxCost = iferror(calculate(sum('Projects'[Amount]))*.06,0)

 

Now in matrix the rows I have the projects & under that I have them broken down to a lower level to show what makes up those costs. Is there a way I can assign the measure TaxCost to one of the lower levels. For example line items are:

 

Project:

NYC

      Cost of Material = $100,000

      Labor = $10,000

      Tax Cost = (Blank)

 

Will be extremely helpful it is possible to assign this measure to Tax Cost.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  PeteSil ,

    I created some data:

     

    Do you want to specify a certain level in the matrix to implement the operation?

    You can use the IF + Hasonvalue function to make a hierarchical judgment

    HASONEVALUE function (DAX) - DAX | Microsoft Learn

    IF function (DAX) - DAX | Microsoft Learn

    Measure =
    IF(
       HASONEVALUE('Table'[Group3]),3, // Group3
       IF(
           HASONEVALUE('Table'[Group2]),2, // Group2
           IF(
               HASONEVALUE('Table'[Group1]),1, //Group1
       0)))

     

    Best Regards,

    Liu Yang

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

    • Usha_RK's avatar
      Usha_RK
      Regular Visitor

      Hi there,

       

      I have a similar requirement in that I have a measure to calculate Shipping Income as a % of the sum of the sales value of different products sold in the month.

       

      SI Measure = sumx(Filter('Sales Price Table','Sales Price Table'[BC Sales Code]=XXXXXX),'Sales Price Table'[Monthly Sales Budget]*0.06)
       
      My matrix has a row named Shipping Income and I would like to assign the value of the above measure instead of the 0 under the monthly sales budget column.
       
      Currently the SI Measure is showing up as individual values against each product row.
       
       

       I would like the £19K circled in blue to be reflect as a single value in the cell circled in red ie Shipping Income under Other Sales Category.

       
      Please help.
       
      Thanks
      Usha