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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
mmmarkin
New Member

Connecting Mongo with PowerBi without using a flattened database

Hi, I'm an employee at a thin film fabrication firm. The tldr overall question of mine is whether there's a way to handle deeply nested /hierarchical/ragged data directly in PowerBi. I've tried a few free widgets for hierarchical data but our data seems too complicated for the widgets. Especially since there is no one schema that truly represents the data, as different clients may require machinery with different combinations of components.

To give some background, I'm working with a Mongo DB instance which contains deeply nested hierarchical data. I've provided an example of the data with the field and values randomized below. So far, to connect to PowerBi I've used the Atlas SQL Bi Connector for Mongo, but I've had to make a "copy" database which contains the flattened version of my original database.

The problem with this approach is that there is this intermediary step of flattening the data every time we update the database. I'm in touch with Mongo support about this as well. 
Example:

 

 

{
  "_id": {
    "$oid": "f1e2d3c4b5a697887766554433221100"
  },
  "jeff": "abcde",
  "sprocket": [
    {
      "wibble": "12345678-90ab-cdef-1234-567890abcdef",
      "foo": false,
      "bar": "xyzzy",
      "qux": "plugh"
    }
  ],
  "flibber": [],
  "gizmo": [],
  "wobble": [
    {
      "blorp": "qwerty",
      "snarf": [
        {
          "spaz": "asdfgh",
          "whiz": "zxcvbn"
        }
      ],
      "thingamajig": [],
      "doodad": [
        {
          "foobar": "foobar",
          "frobnicate": "frobnicate",
          "bloop": "bloop",
          "blarp": "blarp",
          "widget": "widget",
          "doohickey": [
            [
              {
                "whatzit": "whatzit",
                "splork": "splork",
                "zibble": [
                  "zibble"
                ],
                "frob": "frob",
                "zork": false,
                "gorp": false
              },
              {
                "whatzit": "whatzit",
                "splork": "splork",
                "zibble": [
                  "zibble"
                ],
                "frob": "frob",
                "zork": false,
                "gorp": false
              }
            ]
          ],
          "bliz": [
            {
              "yarp": "yarp",
              "glorp": "glorp"
            }
          ],
          "zoink": true,
          "flurb": [
            {
              "snizzle": "snizzle",
              "crizzle": false,
              "yibble": "yibble"
            },
            {
              "snizzle": "snizzle",
              "crizzle": false,
              "yibble": "yibble"
            }
          ]
        }
      ]
    }
  ]
}

 

 

1 ACCEPTED SOLUTION
v-junyant-msft
Community Support
Community Support

Hi @mmmarkin ,

I'm sorry I may not understand what you mean, could you provide sample data (not code) of numerical type and what your expected result is? 

Here are some suggestions I can offer you:
For dealing with complex structural hierarchies in your data, Power BI can handle a certain level of hierarchy with its built-in grouping and drill-down functions. 
Use grouping and binning in Power BI Desktop - Power BI | Microsoft Learn
Drill mode in the Power BI service - Power BI | Microsoft Learn

vjunyantmsft_0-1722999439362.png


You can also filter the entire hierarchy by putting all the fields it contains into the slicer. For example:

vjunyantmsft_1-1722999505093.png

If your hierarchy is too complex, you can try using this custom visual:

vjunyantmsft_2-1722999653349.pngvjunyantmsft_3-1722999660026.png

It allows you to filter by searching directly for keywords

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

View solution in original post

2 REPLIES 2
v-junyant-msft
Community Support
Community Support

Hi @mmmarkin ,

I'm sorry I may not understand what you mean, could you provide sample data (not code) of numerical type and what your expected result is? 

Here are some suggestions I can offer you:
For dealing with complex structural hierarchies in your data, Power BI can handle a certain level of hierarchy with its built-in grouping and drill-down functions. 
Use grouping and binning in Power BI Desktop - Power BI | Microsoft Learn
Drill mode in the Power BI service - Power BI | Microsoft Learn

vjunyantmsft_0-1722999439362.png


You can also filter the entire hierarchy by putting all the fields it contains into the slicer. For example:

vjunyantmsft_1-1722999505093.png

If your hierarchy is too complex, you can try using this custom visual:

vjunyantmsft_2-1722999653349.pngvjunyantmsft_3-1722999660026.png

It allows you to filter by searching directly for keywords

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

mmmarkin
New Member

The goal is to use slicers to create a search tool.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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