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!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
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:
The desired result:
M=Margin
C=Cumulative
My data souce:
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.
@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.
Proud to be a Super User! |
|
User | Count |
---|---|
8 | |
8 | |
5 | |
5 | |
3 |