The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I am having difficulty getting the min start date, and the max end date of a group of records.
The fact table contains a personID, their start and end date. There can be multiple rows for a person.
I want to get the date they started, the minDate and the day they finished, their max endDate.
Id like this to be in a calculated column.
I can do it if i use the dates in the fact table but if i use dimensions, i am stuck.
Note i cannot enable bidirectional filtering due to ambiguity issues.
Below is a screenshot of the raw data, and the end goal.
There is also a link to a pbix with the data loaded.
Thank you for any help
Solved! Go to Solution.
Hi @wilson_smyth ,
I made some modifications to your PBIX file, please if the new calculated table meets your requirement. Alternatively, you could generate MinStartDate and MaxEndDate as calculated columns in source data table.
Best regards,
Yuliana Gu
Hi @wilson_smyth ,
I made some modifications to your PBIX file, please if the new calculated table meets your requirement. Alternatively, you could generate MinStartDate and MaxEndDate as calculated columns in source data table.
Best regards,
Yuliana Gu
@wilson_smyth try following measure
Min Date = CALCUATE ( MIN( Table[Start Date] ), ALLEXCEPT( Table, Table[PersonId] ) ) Max Date = CALCUATE ( MAX( Table[End Date] ), ALLEXCEPT( Table, Table[PersonId] ) )
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@wilson_smyth If the above solution does not return the results you are looking for. Try looking at the post below.
https://community.powerbi.com/t5/Desktop/Using-Group-By-and-MAX/td-p/170699
@KayceVC thank you! but i have managed to figure it out if the data is all in one single table. The difficulty comes when i am using a date dimension. The value from the date dimension will be on the report, not the date from the fact table.
@wilson_smyth you will have something to connect your fact table with date table. I dont see this as issue even if there is date dimension. How your fact is linked with date table? I looked at your pbix, if tht is what your model is then measures I provided would work. May be I'm missing something here or you are over thinking it.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2k Thanks for the quick response!
I had gotten that far, but the issue is i am using a date dimension, so i cannot use the value from the fact table.