March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
Register NowGet certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
I have dataset with Date, Site name, Product Name, Sales Amount. I want to create cumulative line chart with sales by different products (Different lines for every products), Also I want to create Total line of that products in one line chart. It should be dynamic based on selected value in slicers (Year) & (Site name).
I want to create chart with X-Axis as Month-Year (mmm-yyyy), Y-Axis as Running total of Sales Amount, legends as different Products and Total of different products.
1> Method : Running Total
I tried to create it by using quick measure -> running total. it works perfectly dynamic with slicers but with this method I didn't get separate Total line.
2> Method : Createing Parameter
I tried to create line chart using Parameter by all products and total. Chart perfectly created with different peoduct line and Total line, But it didn't work with silcer.
SO, please provide guidence regarding how can I create cumulative line chart with total line which is dynamic with slicer values.
For this, you will need a disconnected table that contains the products and another row for the total and then you create a measure to return the value per category and the total value.
Total Revenue2 =
IF (
SELECTEDVALUE ( Category_with_total[Category] ) = "Total",
[Total Revenue],
CALCULATE (
[Total Revenue],
KEEPFILTERS (
TREATAS ( VALUES ( Category_with_total[Category] ), Category[Category] )
)
)
)
In the screenshot below, you can see that there is a separate line for total.
You can then apply the cumulative calculation to this measure. Please see attached pbix for the details.
Proud to be a Super User!
Hi @danextian,
I already tried this but it didn't work dynamically. As it disconnected table chart doesn't change based on slicer's seleted value (Site Name).
What do you mean it doesnt change? The measure still references the fact table that other dimension tables have a relationship to. You can see in the image below that the viz still responds to the slicer selection as the underlying measure references a table that is related to geo.
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
Check out the November 2024 Power BI update to learn about new features.
User | Count |
---|---|
116 | |
82 | |
77 | |
66 | |
57 |
User | Count |
---|---|
132 | |
114 | |
98 | |
80 | |
78 |