cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

MDX Import returns all levels from selected dimension instead of one

Hi all,

My multidimensional db has chart of accounts dimension (ragged), and when I attempt to import data for one of the account's children, instead of one Account column I get all Levels in multiple columns instead:

 

KMST_0-1594368223672.png

 

Query I use:

WITH MEMBER [Measures].Dummy as 100
select
{ [Measures].[Dummy] } ON 0,
{ [Account].[H1].[100399_Rev_Ext_ex_ex].children } ON 1
FROM [Finance]

 

I was writing this query in SSMS, where result was somewhat different, with only one column for accounts. I wonder if there is a way to achieve same result as in SSMS in PBI (and not only for getting children, but also using DESCENDANTS for taking wider scope), where only one column is returned for accounts:

KMST_1-1594368473363.png

 

I've been googling for some time, but failed to find the solution so far. Thanks for any suggestions.

 

1 REPLY 1
Highlighted
Super User III
Super User III

Re: MDX Import returns all levels from selected dimension instead of one

Hi @KMST ,

don't know if it's possible to achieve this with an adjusted MDX script.

But you can easily achieve the desired format by adding a column with this formula:

 

Record.FieldValues( Record.RemoveFields(_, {"[Measures].[Dummy]"}))

This returns a list with all non-Dummy-values that you can then expand vertically.

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Helpful resources

Announcements
Meet the 2020 Season 2 Power BI Super Users!

Meet the 2020 Season 2 Power BI Super Users!

Find out who's part of the program this season, and welcome the new Super Users.

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

July 2020 Community Highlights

July 2020 Community Highlights

Learn about the exciting things that happened in July.

Featured Data Story of The Month

Featured Data Story of The Month

All Data Stories Gallery contributions are reviewed for each month. We select a contribution and feature the community member the following month.

Power BI Dev Camp - Developing with .NET Core

Power BI Dev Camp - Developing with .NET Core

Learn how to develop custom web applications for Power BI using .NET Core 3.1 and .NET 5.

Top Solution Authors
Top Kudoed Authors