cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

Accepted Solutions
Highlighted
Regular Visitor

Re: Need help without dax

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
Highlighted
Super User I
Super User I

Re: Need help without dax

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!


Proud to be a Super User helping give back to the community!
Thank You!




Highlighted
Regular Visitor

Re: Need help without dax

Thank u sir, I will try your method. 

 

 

 

Highlighted
Regular Visitor

Re: Need help without dax

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? 

 

 

Highlighted
Community Support
Community Support

Re: Need help without dax

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.
Highlighted
Regular Visitor

Re: Need help without dax

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

Highlighted
Regular Visitor

Re: Need help without dax

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

 

Thank you

Highlighted
Super User I
Super User I

Re: Need help without dax

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!


Proud to be a Super User helping give back to the community!
Thank You!




Highlighted
Regular Visitor

Re: Need help without dax

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? 

Highlighted
Super User I
Super User I

Re: Need help without dax

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!


Proud to be a Super User helping give back to the community!
Thank You!




Helpful resources

Announcements
Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors