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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
chaima1
Regular Visitor

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. Capture.PNG

Thank you

1 ACCEPTED SOLUTION

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

View solution in original post

11 REPLIES 11
fhill
Resident Rockstar
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




Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
Thank You!




Thank u sir, I will try your method. 

 

 

 

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? 

 

 

Hi @chaima1,

 

You can try to use below formula to get the top 2 produce of each period.

 

unpivot table.

4.PNG

 

Add rank to filter table.

 

Table = FILTER(ADDCOLUMNS(Sheet1,"Rank",RANKX(FILTER(ALL(Sheet1),[periode]=EARLIER(Sheet1[periode])),[Value])),[Rank]<3)

 

 

5.PNG

 

Regardsm

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Thank you so much both of you, 

 

That works very good now, I want just to add a filter on the dates. I order that the user can choose more that one date, and at the same time that will looks good. 

 

Thanks again

I wish that you can help me to visualize the evolution of % of my top products by a graphic, 

 

Thank you

Your need sounds like using pareto chart which is fully described here https://powerbi.tips/2016/10/pareto-charting/

fhill
Resident Rockstar
Resident Rockstar

With date being your primary data element between the 4 products, consider a Line or Area chart at the very basic level.  There's numerous other options, but I'm not sure what you %'s represent???  To go any deeper, you may need to bring in Non-Percentage values to look sales over time, or consider adding KPI (Key Performance Indicators).  For example, each product needs to sell X% to be profitable?  So how far over / under that profit line is the product?  We can go on and on, but ask yourself "What questions get asked the most around the office, and how can I answer them with 1 Visual?  (Or a grouping of visuals?)"

 

FOrrest




Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
Thank You!




My percentages are just like how much  are my sales from the good type of the product.  

The point I can get any graphics even the sample ones, I don't know why? 

fhill
Resident Rockstar
Resident Rockstar

I'm guessing your data still has "6 %" as a Text field.  You can't graph Text data.  You'll need to SPLIT the data to get just the numbers and make it a Numberic field before graphing... 

 

Beyond this you may need to share your PBIX file for us to see what's happening.... FOrrest




Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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