Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi Power BI Experts,
How can i acheive the below expected output. Please share the dax code.
Solved! Go to Solution.
Could you pls provide some sample data?
maybe you can this
Proud to be a Super User!
Thanks for the reply from @ryan_mayu , please allow me to provide another insight:
Hi,@PrakashPalle
Regarding the issue you raised, my solution is as follows:
1.First I have created the following table and the column names and data are the data you have given:
2.Then add the index column to the powerquery:
3.Create calculated column references:
Column =
VAR FIRST=CALCULATE(MIN('MAIN'[Index]),ALLEXCEPT(MAIN,'MAIN'[ID]))
RETURN IF('MAIN'[Index]=FIRST,'MAIN'[Quanlity],BLANK())
Column 2 =
VAR CI='MAIN'[ID]
VAR RANKC=RANKX(FILTER('MAIN','MAIN'[ID]=CI),'MAIN'[Index],,ASC,Dense)
RETURN IF(RANKC=1,'MAIN'[Quanlity],BLANK())
I've given you two options that you can choose according to your needs.
5.Here's my final result, which I hope meets your requirements.
Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Please find the attached pbix relevant to the case.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the reply from @ryan_mayu , please allow me to provide another insight:
Hi,@PrakashPalle
Regarding the issue you raised, my solution is as follows:
1.First I have created the following table and the column names and data are the data you have given:
2.Then add the index column to the powerquery:
3.Create calculated column references:
Column =
VAR FIRST=CALCULATE(MIN('MAIN'[Index]),ALLEXCEPT(MAIN,'MAIN'[ID]))
RETURN IF('MAIN'[Index]=FIRST,'MAIN'[Quanlity],BLANK())
Column 2 =
VAR CI='MAIN'[ID]
VAR RANKC=RANKX(FILTER('MAIN','MAIN'[ID]=CI),'MAIN'[Index],,ASC,Dense)
RETURN IF(RANKC=1,'MAIN'[Quanlity],BLANK())
I've given you two options that you can choose according to your needs.
5.Here's my final result, which I hope meets your requirements.
Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Please find the attached pbix relevant to the case.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Could you pls provide some sample data?
maybe you can this
Proud to be a Super User!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.