Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi Community,
I need help with a matrix visualization in Power BI. My dataset includes items grouped under "Crop" which contains "Area_planted" and "Crop_yield." I want to show a ratio (Area_planted / Crop_yield) for the "Crop" group, but display the actual values for "Area_planted" and "Crop_yield" items.
Here is the measure I’m using for the ratio:
```dax
Crop Ratio =
DIVIDE(
CALCULATE(
SUM('balance_sheet'[Value]),
'balance_sheet'[Items] = "Area_planted"
),
CALCULATE(
SUM('balance_sheet'[Value]),
'balance_sheet'[Items] = "Crop_yield"
),
0
)
And here is the measure to display values in the matrix:
TheTableMeasure =
IF(
SELECTEDVALUE('balance_sheet'[Items (groups)]) = "Crop",
[Crop Ratio],
[Actual Value Measure]
)
However, when I apply this, the "Area_planted" and "Crop_yield" rows show the same ratio value as the "Crop" group, instead of their actual values. How can I display the ratio only for the "Crop" group and the actual values for "Area_planted" and "Crop_yield"?
Thanks for your help!
Hi @muhammad_bens ,
Whether your problem has been resolved? If no, please update the formula of measure [Measurement table] as below and check if it can return the expected result...
Measurement table =
IF (
ISINSCOPE ( 'Balance'[Articles(Collections)] ),
IF (
SELECTEDVALUE ( 'Balance'[Articles(Collections)] ) = 'Crop',
[harvest report],
[Actual value measurement]
)
)
If the above one can't help you get the expected result, please provide some raw data in your tables(exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:
How to provide sample data in the Power BI Forum
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Thank you aduguid for replying to my message. I had to make some changes to your code due to a context error, and this is the result:
Measurement table =
if (
ISINSCOPE('Balance'[Articles(Collections)]) && SELECTEDVALUE('Balance'[Articles(Collections)]) = 'Crop',
[harvest report],
[Actual value measurement]
)
It always shows the same result 😞
Pls let us know if the carry out group also contains area planted and crop yield data ?
thanks Rakesh for responding , no , carry out do not contains area planted and crop yield
Give this a try using INSCOPE
TheTableMeasure =
IF (
ISINSCOPE ( 'balance_sheet'[Items (groups)] ) && 'balance_sheet'[Items (groups)] = "Crop",
[Crop Ratio],
[Actual Value Measure]
)
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.