The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I am trying to develop a Ticket Sales cumulative line graph sectioned out by how many weeks before the event the tickets were bought.
I used the following DAX command to get the cumulative total.
And here is the graph that results from this measure.
The issue that appears is the data points of 0 display as the maximum, or what is known as the final total at 0 Weeks Out from the event. What is even more confusing is that the cumulative total measure recognizes those data points as 0s because let's say the final total is 100; those 0s show up as 100 but the measure does not count them because it knows they are 0s.
This problem is even more apparent when I insert a legend.
All of these spikes are weeks where no tickets were sold, and instead of maintaining the past week's total, they spike to the maximum (final total) and are not included in the measure's calculation.
I have also considered excluding these data points that spike, since they would be 0 anyway, but there are over 1500 that would need to be excluded and after 50, PowerBI gives me an error.
Is there anything I can include in my DAX command to make these "spikes" smooth out and carry over the past week's total?
Solved! Go to Solution.
Hi @jdoehrman ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(2) We can create a measure.
Better RT =
VAR __Date = MAX('Table'[Bought_Weeks_Out])
VAR __Table = FILTER(ALLSELECTED('Table'),[legend]=MAX('Table'[legend]) && [Bought_Weeks_Out] >= __Date)
RETURN
SUMX(__Table,COUNT('Table'[ticket_id]))
(3) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @jdoehrman ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(2) We can create a measure.
Better RT =
VAR __Date = MAX('Table'[Bought_Weeks_Out])
VAR __Table = FILTER(ALLSELECTED('Table'),[legend]=MAX('Table'[legend]) && [Bought_Weeks_Out] >= __Date)
RETURN
SUMX(__Table,COUNT('Table'[ticket_id]))
(3) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@jdoehrman Looks like a single table data model and in that case CALCULATE will cause you trouble. Use a No CALCULATE approach: Better Running Total - Microsoft Fabric Community
@Greg_Deckler Thank you for the reply, the video was great.
The cumulative total overall is fixed,
However Week 0 is showing a total of 18171.
But when I add in my legend, it seems to be combining all of them in their weird way and inflating the totals. This problem is solved when I single-in on just one of these but the goal is to have them all on the graph.
Edit: I am also noticing the issue of when a legend group doesnt sell a ticket within "0 weeks out" their line will stop at the last week they sold. Is there a way to always include a final number on week 0?
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
21 | |
19 | |
18 | |
16 | |
13 |
User | Count |
---|---|
38 | |
38 | |
23 | |
21 | |
17 |