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.
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?
Customer | Date | Renewal Status |
7/30/20 | Green | |
Microsoft | 7/30/20 | Green |
Amazon | 7/30/20 | Red |
8/30/20 | Yellow | |
Microsoft | 8/30/20 | Green |
Amazon | 8/30/20 | Yellow |
Tesla | 8/30/20 | Green |
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:
and here is sample pbix file, plase try it.
Regards,
Lin
@Anonymous - See New and Returning Customers:
https://community.powerbi.com/t5/Quick-Measures-Gallery/New-and-Returning-Customers/m-p/168297#M13
@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.
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 |
---|---|
112 | |
97 | |
82 | |
67 | |
61 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |