Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
I have a dataset that contains a unique identifier that is on multiple rows. Each row has 2 possible dates and ab indicator. I would liek to create a column that returns one date from those available.
ID | Policy or Quote | Quote Date | Policy Date | New Date Column |
1 | Quote | 01/01/2019 | null | 01/01/2019 |
1 | Policy | null | 02/01/2019 | 01/01/2019 |
2 | Policy | null | 03/01/2019 | 03/01/2019 |
3 | Policy | null | 04/01/2019 | 04/01/2019 |
4 | Policy | null | 05/01/2019 | 04/01/2019 |
4 | Quote | 04/01/2019 | null | 04/01/2019 |
From the above table you can see the new column I'm trying to create. I want to show the quote date for an ID which will take the quote date if there is a quaote, but when there is no quote and only a policy, i will take the policy date as the quote date.
I hope this makes sense, and thanks in advance.
Solved! Go to Solution.
Hi @Anonymous
This checks for a quote date, and if there is not one it uses the policy date and if there is one, then it uses the quote for all rows that have that policy ID. Here is my PBIX POLICY DATE
Matches your column.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
NewQuoteDate = IF ( ISBLANK ( CALCULATE ( MIN ( PolDate[Quote Date] ), ALLEXCEPT ( PolDate, PolDate[ID] ) ) ), PolDate[Policy Date], CALCULATE ( MIN ( PolDate[Quote Date] ), ALLEXCEPT ( PolDate, PolDate[ID] ) ) )
Proud to be a Super User!
Hi @Anonymous ,
In Power Query add a conditional column. Use If (table[Quote Date] <> "NULL", table[Quote Date], table[Policy Date])
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Proud to be a Super User!
Hi @Anonymous ,
So, looking at your table more closely, the logic is:
Use the quote date for both lines, else use the policy date.
Let me know if that is the case. I will be back on line in a couple of hours.
Nathaniel
Proud to be a Super User!
Hi @Anonymous
This checks for a quote date, and if there is not one it uses the policy date and if there is one, then it uses the quote for all rows that have that policy ID. Here is my PBIX POLICY DATE
Matches your column.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
NewQuoteDate = IF ( ISBLANK ( CALCULATE ( MIN ( PolDate[Quote Date] ), ALLEXCEPT ( PolDate, PolDate[ID] ) ) ), PolDate[Policy Date], CALCULATE ( MIN ( PolDate[Quote Date] ), ALLEXCEPT ( PolDate, PolDate[ID] ) ) )
Proud to be a Super User!
Thanks very much for the quick reply. Is it possibel to only use the policy date when there is no associated quote? Like the instances of ID's 2 & 3?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
124 | |
79 | |
49 | |
38 | |
37 |
User | Count |
---|---|
196 | |
80 | |
70 | |
51 | |
42 |