Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello !
I'm connecting PowerBI and Salesforce
I would like to build a graph showing the cumulated sales result progress against a cumulated running target which end on the salesperson's quota.
To create the cumulative sum / running total of results, I've been using: https://www.youtube.com/watch?v=RVcJ3O_O2Jg
This post : https://community.powerbi.com/t5/Desktop/cumulative-target-line/td-p/730076 - suggests to create a "day of year" measure or calculated column.
However, my fiscal year starts on April 1st, and the the day of year "classic" formula based on DATEDIFF provides negative values for days from January 1st to march 31st :
DayNoOfYear = DATEDIFF ( DATE ( YEAR ( 'Table'[Date] ), 4, 1 ), 'Table'[Date], DAY ) + 1
( found also here : https://community.powerbi.com/t5/Desktop/Day-number-of-year/td-p/55688 )
March 31st => -1 (when it should be 365)
March 29th => -2 (when it should be 364)
March 28th => -3 ...
Would you have any idea on how to solve this ?
Many thanks in advance 🙂
Create a calendar table and mark it as date and use datesytd, totalytd
Example
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(('Date'[Date]),"3/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"3/31"))
Last complete YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"3/31"))
Last to last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
2 Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
Cumm Sales overall = CALCULATE(SUM(Sales[Sales Amount]),filter(sales,sales[date] <=maxx(date,date[date])))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s.
Refer
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin
Hello @amitchandak ,
thank you for your help in here :)I've been following your links and advices, but I'm not going forward yet.
This is the basic view I'm trying to obtain :
YTD sales against a target sales quota (black line) for each month of the fiscal year
Ideally I would add more information such as last year's YTD and expected revenue for the end of the year (displaying future opportunities which are neither won or lost)
I followed you links and advices to restart from scratch and create a new data table and two first measures, here is what I have right now :
I'm displaying :
Filters :
In X axis : CloseDate of the Opportunities
Values :
My original data tables look like this (without measures) :
Each sales user manage several Opportunities.
Each Opportunity has a name, an amount, a CloseDate (expected or definitive) and a StageName ( Prospecting > Proposal > Negotiation > Won > Lost )
Any idea why your YTD Amount and Last YTD Sales doesn't work for me?
Any idea on how I could add a black line to represent my YTD target ?
Many thanks for your time 🙂
Slowly making progress. It hit me last night, I could just create a table with :
Date | TargetRevenue | TargetRevenue 50% |
04/01/2019 | 0 | 0 |
31/03/2020 | [finaltarget] | [halftarget] |
I also understood that I should use the Date dimension created instead of the CloseDate as X axis.
I have yet to understand why it changes the graph.
I can see that your formula calculates a value for each date of the calendar, which results in a staircase graph when sales users only forecast opportunities to the last day of each month.
I don't know if there is a way to avoid that. Maybe by better understanding date hierarchies and how to create them. (If anyone has a suggestion 🙂 )
I also understand that this date hierarchy will be necessary to compare Year on Year values.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |