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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
foyiq
Advocate I
Advocate I

Using Measures as Axis in line chart

I would like to build a simple graph like the following (from Excel - X-axis shows running total quantity, and the Y-axis shows per ton margin.

😞17-10-2017 16-39-53.png

 

 

Now, I managed to put this in PBI using the index column, and the best result I got is this:

18-10-2017 9-37-46.png

 

As you may see, this scatter plot is not presentation-friendly. As the values I use are measures, I am not being able to get the same result from line graphs. I also could not manage to build a calculated column for running total quantity. The measure formula is as follows:

Q-ty(tn) running total in Index = 
CALCULATE(
	SUM('Result'[Aggr.Qty]);
	FILTER(
		ALLSELECTED('Result'[Index]);
		ISONORAFTER('Result'[Index]; MAX('Result'[Index]); DESC)
	)
)

 

Please, advise me on getting the desired output, which is a simple line with running total qty on X and per ton margin on Y.

 

1 REPLY 1
v-yuezhe-msft
Employee
Employee

@foyiq,

Create a calculate column that represents running total using DAX below, then create line chart and check if you get expected result.


Running Total COLUMN =
CALCULATE (
    SUM ( 'Result'[Aggr.Qty]);
    ALL ( 'Result' );
    'Result'[Index]<= EARLIER ('Result'[Index])
)

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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