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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Filippomonti
Frequent Visitor

Display True or False if is active a measure in matrix

Hi all,

i have a problem with my report. As you can see in the following tables, I have a report with two different sheets.

In the first one i have products with their prices and the result calculated like "Product" * "Price", in the second sheet i have products with their unit costs and the Result calculated like "Product" * "Unit Costs".

I want to create a single measure "Result" that calculate "Product" * "Price" or "Product" * "Unit Costs" according to the measure that is present in the matrix.

So, if in the matrix is present "Price" -> Result must display "Product" * "Price" otherwise, if is present Unit Costs -> Result must display "Product" * "Unit Costs".

 

Report Sheet Revenue
Business UnitsProductPriceResult
BU1          156  0,5          78
BU2  168.768  0,3  50.630
BU3    46.876  0,2    9.375

 

Report Sheet Costs
Business UnitsProductUnit CostResult
BU1    8.761   0,9    7.885
BU2       647  0,4       259
BU3       684  0,8       547

 

thank you for your kind help.

 

Have a nice day

 

Filippo

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Filippomonti ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

(2)Create a field parameter.

vtangjiemsft_0-1695006312676.png

(3) We can create a measure. 

Result = SWITCH(TRUE(),
SELECTEDVALUE('Parameter'[Parameter Order])=0,MAX('Report Sheet Revenue'[Price])*MAX('Report Sheet Revenue'[Product]),
SELECTEDVALUE('Parameter'[Parameter Order])=1,MAX('Report Sheet Costs'[Unit Cost])*MAX('Report Sheet Costs'[Product]))

(4) Then the result is as follows.

vtangjiemsft_1-1695006352379.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

1 REPLY 1
Anonymous
Not applicable

Hi @Filippomonti ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

(2)Create a field parameter.

vtangjiemsft_0-1695006312676.png

(3) We can create a measure. 

Result = SWITCH(TRUE(),
SELECTEDVALUE('Parameter'[Parameter Order])=0,MAX('Report Sheet Revenue'[Price])*MAX('Report Sheet Revenue'[Product]),
SELECTEDVALUE('Parameter'[Parameter Order])=1,MAX('Report Sheet Costs'[Unit Cost])*MAX('Report Sheet Costs'[Product]))

(4) Then the result is as follows.

vtangjiemsft_1-1695006352379.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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