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

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.

Reply
Anonymous
Not applicable

Historical trends based on date

Hi all, I have a table that contains both recent and historical data from the customer base. The rows with date 7/30/20 were the customer base on this date, and 8/30/20 represents the customer base on 8/30/20. So as we can see, the renewal status of a few customers changed, and Tesla was added as a new customer. 

 

I want to be able to create a table visual showing only customers whose renewal status changed from 7/30/20 to 8/30/20 (in this case it would be LinkedIn and Amazon). I also want to be able to create a visual showing only the new customers between 7/30/20 and 8/30/20 (in this case, just Tesla). Any thoughts on how to do this?

 

CustomerDateRenewal Status
LinkedIn7/30/20Green
Microsoft7/30/20Green
Amazon7/30/20Red
LinkedIn8/30/20Yellow
Microsoft8/30/20Green
Amazon8/30/20Yellow
Tesla8/30/20Green

 

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

For your case, create two measure as below:

renewal status changed = 
var _table= SUMMARIZE('Table','Table'[Customer],"_countstatus",CALCULATE(DISTINCTCOUNT('Table'[Renewal Status])))
return
COUNTAX(FILTER(_table,[_countstatus]>1),[Customer])
new customers = 
var _table= SUMMARIZE('Table','Table'[Customer],"_countstatus",CALCULATE(COUNTA('Table'[Renewal Status])))
return
COUNTAX(FILTER(_table,[_countstatus]=1),[Customer])

Result:

1.JPG

 

and here is sample pbix file, plase try it.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Super User
Super User

@Anonymous - See New and Returning Customers:

https://community.powerbi.com/t5/Quick-Measures-Gallery/New-and-Returning-Customers/m-p/168297#M13

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@Anonymous , Assume you have choose 2 dates in slicer .

//Date Table is connected to table

Measure =
var _min = maxx(allselected(Date),Date[DAte])
var _max = maxx(allselected(Date),Date[DAte])
return
if( calculate(max(Table[Renewal Status]), filter(Date, Date[Date] =_max)) <>calculate(max(Table[Renewal Status]), filter(Date, Date[Date] =_min)) , "Changed" ,"Same")

//Date Table is not connected to table

Measure =
var _min = maxx(allselected(Date),Date[DAte])
var _max = maxx(allselected(Date),Date[DAte])
return
if( calculate(max(Table[Renewal Status]), filter(Table, Table[Date] =_max)) <>calculate(max(Table[Renewal Status]), filter(Table, Table[Date] =_min)) , "Changed" ,"Same")

 

Same way you can use time intelligence if it only one entry per month

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))

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/

See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184


Appreciate your Kudos.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.