Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Cumulative Sales in Play Axis

Good Day Everyone,

 

I am trying to utilize the play axis to visualize a bar graph of sales by customer over time.  I was able to set-up the play axis so that it shows me the correct total by the day, but it is not showing me the cumulative totals. 

 

For my data, I have a calendar table, but I am using the sales date availabe in the invoice register, so there are no relationships being used in my visual.  For the cumulative sales, I am using the following measures, which returns the correct value for other visuals, but not for the play.

 

Cumulative Invoiced CAD =
calculate([Total Revenue $$$ (CAD)],
Filter(allselected(CalendarDate),
CalendarDate[Date]<=max(CalendarDate[Date])))
 
I have tried using the "CalendarDate[Date]" field from my calendar table and I get the same result.
 
Any suggestions would be appreciated.
 
Thanks,
Rich
8 REPLIES 8
Anonymous
Not applicable

Hi Everyone,

 

I wanted to give this a bump back up to the top of the forum and clear up any confusion over my relationships.

 

I have changed my date reference to be the one from my calendar table.  This is consistent across all of my visuals and generally it gives me the results I need.  

 

I am still not able to show the cumulative sales by customer.  When I run the play axis, I am getting the correct dollars invoiced each day, but it is only showing me one day at a time, it is not showing my the cumulative total over the time frame.  

 

Another issue I am facing is that it is already ranking my customer list by highest cumulative sales.  I would prefer if it showed all customers starting at $0 so that I can see the change over time.  See below for the starting point of the chart,

 

klew31_0-1630098054187.png

 

 

Any guidance would be appreciated

 

Cheers!

Ashish_Mathur
Super User
Super User

You said "For my data, I have a calendar table, but I am using the sales date availabe in the invoice register, so there are no relationships being used in my visual".  Why??????

Cumulative Invoiced CAD = calculate([Total Revenue $$$ (CAD)],datesytd(CalendarDate[Date],"31/12"))
Ensure that you drag Year/Month name/Date from the Calendar Table to your visual.

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
parry2k
Super User
Super User

@Anonymous as I mentioned, you need to set the relationship and your original measure should work. 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

I am getting the same result whether I use the date in the invoice register or the calendar table date.  I have made the change to the date table field for convenience.  

 

selimovd
Super User
Super User

Hey @Anonymous ,

 

I think you can solve that easier with the DATESBETWEEN function.

Try the following measure:

Cumulative Invoiced CAD =
CALCULATE(
    [Total Revenue $$$ (CAD)],
    DATESBETWEEN(
        CalendarDate[Date],
        MIN( ALL( CalendarDate[Date] ) ),
        MAX( CalendarDate[Date] )
    )
)

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 
Anonymous
Not applicable

Hi Denis,

 

When I try your DAX I get the following error "The MIN function only accepts a column reference as an argument.".  I do not understand this error as my date is a column (not a measure).

 

Any guidance on where the error is?

Anonymous
Not applicable

I just remove the "All" portion of the DAX and re-ran the visual and it is still giving me the result where it is showing me the individual sales on each day instead of cumulative sales each day.

 

Any other thoughts?

parry2k
Super User
Super User

@Anonymous you have to set the relationship between invoice date and calendar date and use calendar date wherever you are using date. That is the right way to do things.

 

Follow us on LinkedIn

 

Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.