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
I have a dataset that has 3 columns Product, Expiry Date and Report Date.
| Report Date | Product | Expiry Date |
| Dec-21 | PPPT-01 | 25/01/2024 |
| Dec-21 | WEC-54 | 05/06/2023 |
| Dec-21 | ERRE-66 | 23/08/2025 |
| Jan-22 | PPPT-01 | 01/01/2024 |
| Jan-22 | WEC-54 | 05/06/2023 |
| Jan-22 | ERRE-66 | 23/08/2025 |
| Feb-22 | PPPT-01 | 01/01/2024 |
| Feb-22 | WEC-54 | 15/06/2023 |
| Feb-22 | ERRE-66 | 23/08/2025 |
| Mar-22 | PPPT-01 | 25/01/2024 |
| Mar-22 | WEC-54 | 15/06/2023 |
| Mar-22 | ERRE-66 | 23/08/2025 |
What I a trying to do is create a 4th column called difference. This will output the number of days (+/-) the expiry date has changed per product from the previous month.
The current forumula I'm using is this but it's not working, any suggestions would be appreciated.
difference= sum(Data[Expiry Date])-CALCULATE(SUM(Data[Expiry Date]),PREVIOUSMONTH(Data[Expiry Date].[Date]))
Solved! Go to Solution.
@obriaincian , Make sure report_date is date , a new column
new column =
var _date = eomonth([report_date,-1)
var _max = maxx(filter(Table, [Product] =earlier([Product]) && eomonth([report Date],0) =_date ), [Expiry Date] )
return
datediff(_max,[Expiry Date],day)
@obriaincian , Make sure report_date is date , a new column
new column =
var _date = eomonth([report_date,-1)
var _max = maxx(filter(Table, [Product] =earlier([Product]) && eomonth([report Date],0) =_date ), [Expiry Date] )
return
datediff(_max,[Expiry Date],day)
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.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 67 | |
| 63 | |
| 30 | |
| 30 | |
| 23 |