Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
PeteSil
Frequent Visitor

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.

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @PeteSil ,

I created some data:

vyangliumsft_0-1682476883944.png

 

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)))

vyangliumsft_1-1682476883945.png

 

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

View solution in original post

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

Hi  @PeteSil ,

I created some data:

vyangliumsft_0-1682476883944.png

 

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)))

vyangliumsft_1-1682476883945.png

 

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

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.
 
 
Usha_RK_0-1690540498397.png

 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

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.