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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
LenaRamirez
Regular Visitor

Display Total of Measure on Line Chart

I am new to Power BI. 

 

I have the below visual Table. I would like to hace a Line Chart display the total under "Available To Stock Match" which is a simple measure - Stock Match Qty = [Total Overall Inventory]-[Total Stock Match]-[Total STO]

The issue that I am finding is that since there are negative numbers and I currently have those filtered on the table visual, the line chart is trying to calculate the negative values. I only need positive values. Basically, I need the total on "Available to stock match" to also show on the line chart.

LenaRamirez_0-1725986519554.png

LenaRamirez_1-1725986914897.png

 

 

 

1 ACCEPTED SOLUTION
suparnababu8
Solution Sage
Solution Sage

Hi @LenaRamirez 

You have to correct your meausre to avoid negative values. First you create a calculated as mentioned below to avoide negative values.

Stock Match Qty = 
 VAR StockMQty = [Total Overall Inventory]-[Total Stock Match]-[Total STO]
RETURN IF(StockMQty < 0,0,StockMQty)

Then you create a measure based on this calculated column and use that measure in your line chart. 
I hope it'll work.

Thanks!

 

View solution in original post

2 REPLIES 2
suparnababu8
Solution Sage
Solution Sage

Hi @LenaRamirez 

You have to correct your meausre to avoid negative values. First you create a calculated as mentioned below to avoide negative values.

Stock Match Qty = 
 VAR StockMQty = [Total Overall Inventory]-[Total Stock Match]-[Total STO]
RETURN IF(StockMQty < 0,0,StockMQty)

Then you create a measure based on this calculated column and use that measure in your line chart. 
I hope it'll work.

Thanks!

 

Ritaf1983
Super User
Super User

Hi @LenaRamirez 

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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