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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
Anonymous
Not applicable

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
Anonymous
Not applicable

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors