Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
GURUPRASADB
Helper I
Helper I

Get Last non empty column in hierarchy

Hi,

I have hierarchy table but last values are spilt across many columns based on non empty column. I want to have one column to join Fact table based in code. 

Value column should have last value from last non empty column

Please help me in solving this issue.

coalease.JPG

Expected result

coalease-expected.png

2 REPLIES 2
Mariusz
Community Champion
Community Champion

Hi @GURUPRASADB 

 

Check if your columns are BLANK() or "" COALESCE works with BLANK() if you have "" or " " it will not work, but you can use SWITCH instead.

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn


 

Hi, 

I see COALESCE is working for only one column, but I have 6 columns to check. 

I tried with Switch also it wont work for multiple columns

 

value = SWITCH(TRUE(),
('Fact'[GL Account.Level 10.Key (Not Compounded)])="",'Fact'[GL Account.Level 08.Key (Not Compounded)],
('Fact'[GL Account.Level 08.Key (Not Compounded)])="" || ISBLANK('Fact'[GL Account.Level 08.Key (Not Compounded)]),'Fact'[GL Account.Level 07.Key (Not Compounded)],
'Fact'[GL Account.Level 11.Key (Not Compounded)])
 

coalease.JPG

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.