Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello,
I have the next table:
| ReminderRowID | ReminderID | ContractNr | ContractStartDate | ReminderDate | CustomerID |
| 1 | R1 | C1 | 1-1-2019 | 3-1-2019 | 1001 |
| 2 | R1 | C1 | 1-1-2019 | 3-1-2019 | 1001 |
| 3 | R2 | C2 | 3-1-2019 | 10-2-2019 | 1002 |
| 4 | R3 | C2 | 3-1-2019 | 11-3-2019 | 1002 |
| 5 | R3 | C2 | 3-1-2019 | 11-3-2019 | 1002 |
| 6 | R4 | C3 | 5-1-2019 | 10-4-2019 | 1003 |
| 7 | R5 | C3 | 5-1-2019 | 5-6-2019 | 1003 |
I would like to group by all unique contractnumbers in the table above and show the FIRST reminderdate. After that I would like to calculate the datediff between the contractstartdate and the first reminderdate.
So it will look like this:
| Contractnr | ContractStartDate | FIRST Reminderdate | DaysBetween |
| C1 | 1-1-2019 | 3-1-2019 | 2 |
| C2 | 3-1-2019 | 10-2-2019 | 38 |
| C3 | 5-1-2019 | 10-4-2019 | 95 |
Last of all, I would like to calculate the number of customers that have received their first reminder on a contract withing 30 days...
Could somebody help me fix this business case with DAX?
Thank you!
@Anonymous
my above solution returns you result that you asked for
Hi @Anonymous
try a measure
DaysBetween =
var _firstReminder = CALCULATE(MIN('Table'[ReminderDate]),ALLEXCEPT('Table','Table'[ContractNr]))
return
datediff(selectedvalue('Table'[ContractStartDate]),_firstReminder,DAY)
and measure t count customers within 30 days
COUNTCUSTOMER = calculate(DISTINCTCOUNT('Table'[CustomerID]),FILTER(ALL('Table'),[DaysBetween]<=30))
Hi @Anonymous
New table=Summarize(table,table[ContractNr],table[ContractStartdate],table[Reminderdate],"Between",datediff(max(table[ContractStartdate]),max(table[Reminderdate]),Day))
Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar
If I resolve your problem Mark it as a solution and give kudos.
Hi @Anonymous
unfortunately it didn't work out for me
Hi @Anonymous Have you tried the solution which i have suggested?
Thanks,
Pravin
Could you please share what output you are getting after table creation?
Thanks,
Pravin
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 21 | |
| 10 | |
| 10 | |
| 5 | |
| 5 |