The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I have a table similar to this:
SalesDate | Product | SalesAmount |
2020-01-01 | A | 100 |
2020-01-06 | B | 50 |
2020-01-10 | A | 200 |
I have a measure with the cumulative sales amount and I would like to create a line chart with the measure as the value and having a dynamic index on the X axis. I.e. if there are no filters there should be 100, 150 and 350 in the chart and 1, 2, 3 on the X axis, and if the chart is filtered on product A, there should be 100 and 300 in the chart and 1, 2 on the X axis. How can I accomplish this?
Hi @mjohannesson ,
X-axis is based on column which is static, you could show/hide some of x-axis. But Power BI doesn't support dynamic x-axis value.
How is your measure worded? This should just work with a standard slicer/filter on your product
CumulativeSalesAmount = CALCULATE(SUM(F_Sales[SalesAmount]), FILTER(ALL(F_Sales), F_Sales[WkSalesDate] <= MAX(F_Sales[WkSalesDate])))
This works fine if I put the sales date (from the related Date dimension) on the X axis, but I would like to have a sequential index on the X axis instead.
User | Count |
---|---|
65 | |
61 | |
60 | |
53 | |
27 |
User | Count |
---|---|
181 | |
88 | |
70 | |
48 | |
46 |