Forum Discussion

chaima1's avatar
chaima1
Regular Visitor
9 years ago
Solved

Need help without dax

Hello, 

 

I start using bi power last 3 days, and using it I have to present my top 2 products ( the names of my column in the example)  in each period. My top product is the one which have the top percentage.

Thank you

  • Hello, 

     

    Thank you all of you, I am new with BI power so I make stupid mistakes and I didn't pay attention that my data are text, and I am using %, so for that reason I can't get any graph, now that works very good. 

     

    Thannnnk you

11 Replies

  • fhill's avatar
    fhill
    Resident Rockstar

    Hello,

     

    The sampe data you provided is in a 'pivot' or 'matrix' format, since the dates go down and the product names go to the right.  Import your data into Power BI.  Choose 'Edit' from the import screen, or click 'Edit Queries' to enter the Query Editor menu.  If your product names didn't become Headers automatically, use 'Use First Row as Headers' to move the product names into the darker Header row.

      

    Ctrl + Click to make sure to highlight the 4 products columns (not period) and choose 'Unpivot Columns' from the 'Transform' tab.  This wll put your data into a more usable format with 'Attribute' as the Product Names and 'Value' as the %'s.  You can rename the Attribute and Value columns to something easier to understand.  **Make sure to correct the 'Data Type' for the Value column to Decimal or Percentage (whatever matches your raw data). **  If you raw data had TEXT values with '%' marks in it, you'll have to mass remove the % marks before importing.

     

    From Home Click 'Close and Apply' then add a Table visual to your Page.  Drag your 3 columns into the Table Visual and sort 'Value' by clicking it's header name.  Clck it again to sort descending and you have your top values at the top of your table.  

     

    To only sow the top 2 Products, go under Filters for this Visual and drop down 'Value' (or whatever you renamed it) and choose 'Top N'.  You want the Top '2' Items and drag 'Value' down into the 'Value By' area.  Apply filter and that should work.  

     

    FOrrest

    • chaima1's avatar
      chaima1
      Regular Visitor

      Thank u sir, I will try your method. 

       

       

       

      • chaima1's avatar
        chaima1
        Regular Visitor

        The problem that I have now is when I import my table the name of my colomns will be the date, and I want to make a filter on the dates, so that will not work-just like my table will be overturned, I don't know what should I do?