The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi there,
I would like to create a new column, called Days_between_visits which calculates the number of days between a date in the ATA (Actual Time of Arrival) column and a previous date also in the ATA column, for each vessel in the VesselName column
For the first date of each vessel, Days_between_visits would be null as there is not previous date to calculate the difference with.
Is this possible? If so, please kindly assist with the DAX formula required the calculated column
Thanks,
Wes
Solved! Go to Solution.
I think this calculated column might be close
New Column = VAR LastVisit = MAXX( FILTER( 'Table', 'Table'[VesselName] = EARLIER('Table'[VesselName]) && 'Table'[ATA] < EARLIER('Table'[ATA])),'Table'[ATA]) RETURN IF(LastVisit <> BLANK(),INT('Table'[ATA] - LastVisit))
I think this calculated column might be close
New Column = VAR LastVisit = MAXX( FILTER( 'Table', 'Table'[VesselName] = EARLIER('Table'[VesselName]) && 'Table'[ATA] < EARLIER('Table'[ATA])),'Table'[ATA]) RETURN IF(LastVisit <> BLANK(),INT('Table'[ATA] - LastVisit))
@Phil_Seamark I found this solution very helpful, but I had 2 rows that did not return a value that should have. Do you know why this might of happened?
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
82 | |
77 | |
46 | |
39 |
User | Count |
---|---|
135 | |
109 | |
70 | |
64 | |
55 |