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 all,
I am having trouble to apply a particular value for a row if the id number is a duplicate. I want to apply a value based on a calculated colomn (state of the mission, which is based on the begening and ending dates of a mission).
By the way, i already have identify duplicates thanks to this formula, which gives me a result >1 if ID is a duplicate :
What i have :
Id | State of the mission |
m9306 | Finished |
m9306 | |
m9306 | In progress |
What I want to show :
Id | State of the mission |
m9306 | In progress |
Any idea on how to achieve that ?
Regards
Pingouin Puni
Solved! Go to Solution.
Hi @Pingouin_Puni ,
We can create a calculate column to meet your requirement.
Column =
VAR max_date =
CALCULATE (
MAX ( 'Table'[date] ),
FILTER ( 'Table', 'Table'[id] = EARLIER ( 'Table'[id] ) )
)
RETURN
CALCULATE (
MAX ( 'Table'[State of the mission] ),
FILTER (
'Table',
'Table'[id] = EARLIER ( 'Table'[id] )
&& 'Table'[date] = max_date
)
)
The result like this,
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Pingouin_Puni ,
We can create a calculate column to meet your requirement.
Column =
VAR max_date =
CALCULATE (
MAX ( 'Table'[date] ),
FILTER ( 'Table', 'Table'[id] = EARLIER ( 'Table'[id] ) )
)
RETURN
CALCULATE (
MAX ( 'Table'[State of the mission] ),
FILTER (
'Table',
'Table'[id] = EARLIER ( 'Table'[id] )
&& 'Table'[date] = max_date
)
)
The result like this,
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @v-zhenbw-msft ,
This last solution with a calculated colomn worked perfectly and answered my need. I just replaced dates with the priority idea of @camargos88 , so thank you both of you 🙂
Regards,
Pingouin Puni
Hi @Pingouin_Puni ,
How are you ordering the State of missing column ?
You can give them a numerical values (by priority).
After that you can get the last value per id.
Does that help you ?
Ricardo
Thank you for answering @camargos88 ,
This are the different sates of mission i have and i gave them a priority value:
Status of the mission | Priority |
No mission | 0 |
Mission to come | 0 |
Finished | 0 |
In progress | 1 |
As for the last value par ID, do you know what would be the dax formula ? I'm guessing MAX( ) would be involved but I can't figure it out. I'm still new on DAX, but learn every day 🙂
Pingouin Puni
Hi @Pingouin_Puni ,
Just related both tables by status and create this measure:
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 |
---|---|
130 | |
80 | |
53 | |
38 | |
35 |
User | Count |
---|---|
204 | |
81 | |
71 | |
53 | |
50 |