March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I am trying to plot a line graph using cumulative sum and Date (Non Continious) the issue is the line graph is broken
Measure Code
Cumulative Offer and acceptance Count =
VAR CurrentRowDate = MAX('srs_cap'[cap_decd])
RETURN
CALCULATE(
countrows('srs_cap'),
'srs_cap'[cap_decd] <= CurrentRowDate
)
When i am extracting the data of line chart it is showing as
Cumulative Offer and acceptance Count , Date.
899 03/07/2024 00:00
904 04/07/2024 00:00
1 05/07/2024 00:00
907 08/07/2024 00:00
1 09/07/2024 00:00
910 10/07/2024 00:00
913 11/07/2024 00:00
1 15/07/2024 00:00
915 16/07/2024 00:00
916 17/07/2024 00:00
923 18/07/2024 00:00
928 19/07/2024 00:00
I can see the issue as sum is breaking at some date for eg
913 11/07/2024 00:00
1 15/07/2024 00:00
915 16/07/2024 00:00
it should be 914 on 15/07/2024 instead of 1.
i tried changing X axis to categorical and Continious, Created a Custom Date table, How can i fix this
Solved! Go to Solution.
Hi @gautampruthi - Can you double-check the relationships between your tables and ensure that the Date table covers the entire date range relevant to your data.The main problem is that your cumulative sum calculation doesn't properly handle gaps in the dates, causing it to reset when there's no data for a particular date.
you need to adjust your cumulative measure to reference the Date table rather than just the dates in the srs_cap table.
Cumulative Offer and Acceptance Count =
VAR CurrentRowDate = MAX('DateTable'[Date])
RETURN
CALCULATE(
COUNTROWS('srs_cap'),
'srs_cap'[cap_decd] <= CurrentRowDate,
ALL('DateTable')
)
The cumulative sum should now increment properly, avoiding resets where there are no data points for certain dates.
Hope it helps
Proud to be a Super User! | |
Do you have a date table? It doesn't look like it. Your transaction table contains only the dates of the transactions. It is not possible to return a value (cumulative value in this case) for a date that doesn't exist in your loaded data. If you add a date table containing all dates (including those that have no sales), then you can build the chart you need.
https://exceleratorbi.com.au/power-bi-calendar-tables/
Hi @gautampruthi - Can you double-check the relationships between your tables and ensure that the Date table covers the entire date range relevant to your data.The main problem is that your cumulative sum calculation doesn't properly handle gaps in the dates, causing it to reset when there's no data for a particular date.
you need to adjust your cumulative measure to reference the Date table rather than just the dates in the srs_cap table.
Cumulative Offer and Acceptance Count =
VAR CurrentRowDate = MAX('DateTable'[Date])
RETURN
CALCULATE(
COUNTROWS('srs_cap'),
'srs_cap'[cap_decd] <= CurrentRowDate,
ALL('DateTable')
)
The cumulative sum should now increment properly, avoiding resets where there are no data points for certain dates.
Hope it helps
Proud to be a Super User! | |
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
115 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
164 | |
116 | |
63 | |
57 | |
50 |