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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Power BI issue on Matrix Visual

Hi,

I have some trouble with the Matrix Visual in PowerBI, hope that somebody could help me out:

 

I need to show the sum for my invoices, therefore I created my rows in hierarchical order (like Company Code, Account, Period, Invoice Number). On values (shown as column), I have put my sum field of currency amount which is already stored in my table. So far, so good.

 

But now, I would like to show an additional information like "positive" or "negative" if the period isn't balanced (in a separate column related to my existing sum field). So I tried to insert another value (also as column) based on a measure. In this measure, I tried to "calculate" the correct value but I sadly failed 😕

 

The result should look like this:

Tommi131_1-1603218573609.png

 

In my measure, I tried it like this:

SelectedStatus =

var selectedstatus =

SELECTEDVALUE('Table'[amount])

return if (selectedstatus > 0, "positive", "negative")

 

Now my questions:

1. Is a measure with SELECTEDVALUE the correct way to reach the goal?

2. Is anybody of you able to help me out or provide me the correct DAX query?

 

Thanks & kind regards!

Tommi

1 REPLY 1
Burningsuit
Resident Rockstar
Resident Rockstar

Hi @Anonymous 

In this case you don't need SELECTEDVALUE because the matrix supplies the filter context.

Create a measure:

SelectedStatus = IF( 'Table'[amount]> 0, "positive", "negative")

and put that on the Matrix.

You may need to set a visual level filter "show items when the value is not blank" if you're getting blank items.

You also may need to consider what you want if the 'Table'[amount] = 0. At the moment with my code, following your example it will show "negative" for Zero entries. You may want a measure like this...

SelectedStatus = IF( 'Table'[amount]> 0, "positive",  IF( 'Table'[amount]= 0, "zero", "negative"))

to show zero separately.

Hope this helps

Stuart

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.