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 Everyone,
I have a DAX question, my use case is that I have multiple rows and unknown number of columns (could be between 5-15), the data is generated by a Python script with a single input and generates an ouput with varying number of columns.
I need to find the last column in a given row that has value in it from a conditional column.
Here is an example of the data as reference and the desired output 'Total' which takes the last non blank value from the last 'Child' column that has values.
Appreciate any help with this!
Thanks,
Ilya
@Manoj_Nair Thank you very much for the reply!
I guess that will solve the static case if I have a fixed number of columns. What will happen to the code if I have an additional column or less 2 columns? As I wrote, the number of "Childs" is dynamic and I need to find a way to deal with it dynamically in DAX (or M code) 🙂
BR,
Ilya
@ilyav - pls try this DAX, we used Coalesce.
Let me know if this resolve your issues then please mark as Solution Accepted. Many Thanks
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 21 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 35 | |
| 31 | |
| 19 | |
| 13 | |
| 10 |