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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Bluemoon07
Frequent Visitor

Cumulative as X axis

Hello Power Bi communauty, 

 

I am looking to create an interactive dashboard with the above slicers. I want to create a line chart that shows the evolution of margins on the Y-axis and the cumulative sales on the X-axis relative to the margins. The margins are sorted in descending order. I succeeded in using the table and creating measures. However, I cannot place a measure on the X-axis. How create a cumulative column that also change based on my slicer as a measure.

 

Here are my calculations:

Bluemoon07_1-1742549571384.png

CumulativeMeasure =
SUMX(FILTER(ALLSELECTED('Table'),[RankMeasure] <= MAXX(ALLSELECTED('Table'), [RankMeasure])),'Table'[Sales])
 
RankMeasure = RANKX(ALLSELECTED('Table'),CALCULATE(SUM('Table'[Margin])),,DESC,DENSE)

 

The desired result:

Bluemoon07_2-1742549904003.png

M=Margin

C=Cumulative

 

My data souce: 

Bluemoon07_0-1742549533194.png

 

 

3 REPLIES 3
v-veshwara-msft
Community Support
Community Support

Hi @Bluemoon07 ,

Thanks for reaching out to the Microsoft Fabric Community.

Just checking in to see if your issue has been resolved by now. If not, please consider the following:

In Power BI, measures can't be directly used as the X-axis in visuals like line charts. Since cumulative values based on slicers often depend on measures, a workaround is to create a calculated column that reflects the desired cumulative logic. However, columns are static and don’t respond to slicers in the same way. Alternatively, you can consider creating a disconnected table to define the X-axis points and then use measures that align with those points, leveraging relationships or DAX calculations accordingly.

 

Hope this helps. Please reach out for further assistance.

If another approach has worked for you, please share it here to help the community.

If this response was helpful, kindly mark it as an accepted solution to assist others with similar queries. A kudos would also be appreciated.

 

Thank you.

bhanu_gautam
Super User
Super User

@Bluemoon07 Create the Cumulative Measure:

DAX
CumulativeMeasure =
SUMX(
FILTER(
ALLSELECTED('Table'),
[RankMeasure] <= MAXX(ALLSELECTED('Table'), [RankMeasure])
),
'Table'[Sales]
)

 

Create a Cumulative Margin Measure:

DAX
CumulativeMargin =
SUMX(
FILTER(
ALLSELECTED('Table'),
[RankMeasure] <= MAXX(ALLSELECTED('Table'), [RankMeasure])
),
'Table'[Margin]
)

 

Add a line chart to your report.
Place the CumulativeMargin measure on the Y-axis.
Place the CumulativeMeasure measure on the X-axis.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






@bhanu_gautam I can add a measure as X-axis. This option is not possible...

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.