Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hola,
Me podeis ayudar en una formula para una columna que devolva una fecha (mating Date) para egual primary ID y service >1
Algo como "return (mating date , if primary identidy are the same && service >1)
Espero haber podido explicar
Muchas gracias!
Envio tabla de ejemplo.
PrimaryIdentity | FarmNumber | DateOfBirth | EntryDate | SoldDate | Farrowings | Cycle | Service | X | MatingDate | ||
3947 | 752 | 04/04/2017 | 04/12/2017 | 20/05/2021 | 8 | 9 | 1 | 1 | 04/01/2021 | 04/01/2021 | |
3950 | 752 | 04/04/2017 | 04/12/2017 | 10/06/2021 | 8 | 9 | 1 | 1 | 25/01/2021 | 25/01/2021 | |
3995 | 752 | 07/04/2017 | 11/09/2017 | 27/05/2021 | 7 | 8 | 1 | 1 | 06/01/2021 | 06/01/2021 | |
4008 | 752 | 27/04/2017 | 09/10/2017 | 17/06/2021 | 7 | 8 | 1 | 1 | 25/01/2021 | 25/01/2021 | |
4020 | 752 | 27/04/2017 | 09/10/2017 | 10/06/2021 | 7 | 8 | 1 | 1 | 18/01/2021 | 18/01/2021 | |
4025 | 752 | 27/04/2017 | 09/10/2017 | 10/06/2021 | 7 | 8 | 1 | 1 | 21/01/2021 | 21/01/2021 | |
4039 | 752 | 06/07/2017 | 11/12/2017 | 10/06/2021 | 7 | 8 | 1 | 1 | 25/01/2021 | 25/01/2021 | |
4040 | 752 | 06/07/2017 | 11/12/2017 | 18/11/2021 | 7 | 8 | 1 | 1 | 02/02/2021 | 02/02/2021 | |
4042 | 752 | 06/07/2017 | 11/12/2017 | 08/07/2021 | 7 | 8 | 1 | 1 | 25/01/2021 | 25/01/2021 | |
4042 | 752 | 06/07/2017 | 11/12/2017 | 08/07/2021 | 7 | 8 | 2 | 1 | 20/02/2021 | -> | 25/01/2021 |
4053 | 752 | 06/07/2017 | 11/12/2017 | 22/02/2021 | 6 | 7 | 1 | 1 | 22/01/2021 | 22/01/2021 | |
4054 | 752 | 06/07/2017 | 11/12/2017 | 10/06/2021 | 6 | 7 | 1 | 1 | 15/01/2021 | 15/01/2021 | |
4054 | 752 | 06/07/2017 | 11/12/2017 | 10/06/2021 | 6 | 7 | 2 | 1 | 07/02/2021 | -> | 15/01/2021 |
4059 | 752 | 06/07/2017 | 11/12/2017 | 01/07/2021 | 6 | 7 | 1 | 1 | 08/02/2021 | 08/02/2021 | |
4065 | 752 | 06/07/2017 | 11/12/2017 | 22/07/2021 | 6 | 7 | 1 | 1 | 01/03/2021 | 01/03/2021 | |
41749 | 34 | 02/07/2017 | 29/11/2017 | 08/08/2022 | 10 | 11 | 1 | 3 | 10/03/2022 | 10/03/2022 | |
41854 | 34 | 03/07/2017 | 06/12/2017 | 26/07/2022 | 10 | 11 | 1 | 2 | 09/03/2022 | 09/03/2022 | |
041731@1 | 34 | 02/07/2017 | 29/11/2017 | 29/03/2022 | 10 | 11 | 1 | 3 | 09/03/2022 | 09/03/2022 |
Solved! Go to Solution.
Hi @DBrito79 ,
I have created a simple sample , please refer to my pbix file to see if it helps you.
Create 2 measures.
Measure = var _1=CALCULATE(COUNT('Table'[PrimaryIdentity]),FILTER(ALL('Table'),'Table'[PrimaryIdentity]=SELECTEDVALUE('Table'[PrimaryIdentity])))
return
IF(_1>1&&MAX('Table'[Service])>1,BLANK(),MAX('Table'[MatingDate]))
Measure 2 = MAXX(FILTER(ALL('Table'),'Table'[PrimaryIdentity]=SELECTEDVALUE('Table'[PrimaryIdentity])),[Measure])
Or 2 columns.
Column = var _1=CALCULATE(COUNT('Table'[PrimaryIdentity]),FILTER('Table','Table'[PrimaryIdentity]=EARLIER('Table'[PrimaryIdentity])))
var _2=IF(_1>1&&'Table'[Service]>1,BLANK(),'Table'[MatingDate])
return _2
Column 2 = MAXX(FILTER('Table','Table'[PrimaryIdentity]=EARLIER('Table'[PrimaryIdentity])),'Table'[Column])
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Rongtie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello!
Yes it works and helps a lot! And also helps for another similar formula that I need after.
Thank you very much. You are a genius!
Best Regards
Diogo
Hi @DBrito79 ,
I have created a simple sample , please refer to my pbix file to see if it helps you.
Create 2 measures.
Measure = var _1=CALCULATE(COUNT('Table'[PrimaryIdentity]),FILTER(ALL('Table'),'Table'[PrimaryIdentity]=SELECTEDVALUE('Table'[PrimaryIdentity])))
return
IF(_1>1&&MAX('Table'[Service])>1,BLANK(),MAX('Table'[MatingDate]))
Measure 2 = MAXX(FILTER(ALL('Table'),'Table'[PrimaryIdentity]=SELECTEDVALUE('Table'[PrimaryIdentity])),[Measure])
Or 2 columns.
Column = var _1=CALCULATE(COUNT('Table'[PrimaryIdentity]),FILTER('Table','Table'[PrimaryIdentity]=EARLIER('Table'[PrimaryIdentity])))
var _2=IF(_1>1&&'Table'[Service]>1,BLANK(),'Table'[MatingDate])
return _2
Column 2 = MAXX(FILTER('Table','Table'[PrimaryIdentity]=EARLIER('Table'[PrimaryIdentity])),'Table'[Column])
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Rongtie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
8 | |
7 |
User | Count |
---|---|
13 | |
12 | |
11 | |
11 | |
8 |