Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! 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!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 133 | |
| 88 | |
| 85 | |
| 68 | |
| 64 |