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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
cosminc
Post Partisan
Post Partisan

3 columns from 1 column with 3 dimensions on M Language - Query Editor - previous row value

Hi all,

i need to manipulate on Query Editor (M Language) a base which have 3 dimensions on a column and i have to obtain 3 columns - Category, Subcategory & Items

Note: As a logical step - Category items have always null on the next row from right columns while Subcategory items have values on next row

 

Source:

    
Category A   
subcategory 1   
dasda183721.2100
sdfsd231126.7100
fsds189121.8100
fsdfs168719.5100
fsdfs6337.3100
    
subcategory 2   
fsdfs415748100
fsdfds227826.3100
fdss192522.2100
    
Category B   
subcategory 1   
fsdfsf6507.5100
fsfs99511.5100
fsds91710.6100
fsdfsf99511.5100
fsdfsf123414.3100

 

 

expected results:

 

Category Asubcategory 1dasda183721.2100
Category Asubcategory 1sdfsd231126.7100
Category Asubcategory 1fsds189121.8100
Category Asubcategory 1fsdfs168719.5100
Category Asubcategory 1fsdfs6337.3100
Category Asubcategory 2fsdfs415748100
Category Asubcategory 2fsdfds227826.3100
Category Asubcategory 2fdss192522.2100
Category Bsubcategory 1fsdfsf6507.5100
Category Bsubcategory 1fsfs99511.5100
Category Bsubcategory 1fsds91710.6100
Category Bsubcategory 1fsdfsf99511.5100
Category Bsubcategory 1fsdfsf123414.3100

 

Can you help me with this issue

Thanks,

Cosmin

2 REPLIES 2
vivran22
Community Champion
Community Champion

@cosminc 

 

Hi,

 

Please find the pbix file here

 

There could be other possible ways, but this is what I have come up with and it should solve the purpose.

 

Rgds,

Vivek

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi,

on the  real base the names are different and not connected with the scope, i put that names for a better understanding

i say you used them on conditional columns

the construction have to be something with if below ros is null then column otherwise null

Thanks,

Cosmin

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors