Forum Discussion

Syphimus99's avatar
Syphimus99
Regular Visitor
2 years ago
Solved

Issues with getting data from excel to PBI report

I can't figure out how to get data from an Excel file to a PBI report as a table with different hierarchical categories while there are other columns to be begin with. basically, there are 2 main categories and they have subcategories like 1.1, 1.2, 1.3 and 2.1, 2.2 and even some of those subcategories have few categories inside them such as 2.1.1, 2.1.2 and 2.2.1
Would anyone know how to integrate them into PowerBI? side note: I am not allowed to alter the excel file structure in any way?

UPDATE: I solved it on my own, thanks
  • your code seems to work up until the last line "

    #"Filled Down" = Table.FillDown(#"Added Custom1",{"Category", "Subcategory"})

    "
    I don't seem to understand how do i insert the logic that there are multiple categories and their subcategories.
    I updated the excel file i shared you in the hyperlink, so now the categories name are accurate if you delete the numbers inside the brackets next to their name, Example: EAST BLOCK(Category 1) 
    true value: EASTBLOCK
    and the same goes for the other categories and subcategories.

8 Replies

  • Hello Syphimus99 

    Can we infer from your first screenshot that rows 6 through 13 belong to Category 1.1? If so, then maybe you can do something like this:

    * Create a new custom column that returns Column B, but ONLY fi Column B is a Category Id, such as "1.1". I leave it up to you to write the Power Query M statement that will do that. It should return NULL if Column B is NOT a Category Id. 

    * Now do a Fill Down on the new column.

    * Lastly, get rid of any rows where the new column = Column B.

    • Syphimus99's avatar
      Syphimus99
      Regular Visitor

      Yes, rows 6 through 13 belong to Category 1.1

      I will try your method, thanks for the advice, Will update you if I manage to get it right

  • That is a rather unfortunate format.  You can modify it in Power Query though, to make it usable.

     

    Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

    Do not include sensitive information or anything not related to the issue or question.

    If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216

    Please show the expected outcome based on the sample data you provided.

    Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

    • Syphimus99's avatar
      Syphimus99
      Regular Visitor

      Hey, I Updated my post, there is a link to the sample data, would this be suitable for you?

      • lbendlin's avatar
        lbendlin
        Super User

        Do you need the hungarian task names in column A?