Forum Discussion
Need help without dax
- 9 years ago
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
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
- chaima19 years agoRegular Visitor
Thank u sir, I will try your method.
- chaima19 years agoRegular 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?
- Anonymous9 years agoNot applicable
Hi chaima1,
You can try to use below formula to get the top 2 produce of each period.
unpivot table.
Add rank to filter table.
Table = FILTER(ADDCOLUMNS(Sheet1,"Rank",RANKX(FILTER(ALL(Sheet1),[periode]=EARLIER(Sheet1[periode])),[Value])),[Rank]<3)
Regardsm
Xiaoxin Sheng