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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
pravkan
Frequent Visitor

DAX create calulated table with a specific column name and measures

I have a sales table with below columns 

pravkan_0-1657046343358.png


And I want to create a calculated table that will store bottom n retailer sales per product with the following columns 

  1. Retailer Name
  2. Product Sub Category Name 
  3. Total Sales 

How can I achive this result?



1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @pravkan ,

 

I have built a data sample, please try to add two columns:

Rank Flag = RANKX('Table',[Total each Retailer],,ASC,Dense) *10+
RANKX(FILTER('Table',[Total each Retailer]=EARLIER('Table'[Total each Retailer])),[RETAILER_NAME],,ASC,Dense)
Final Rank = RANKX('Table',[Rank Flag],,ASC,Dense)

Output:

Eyelyn9_0-1659516013709.png

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @pravkan ,

 

I have built a data sample, please try to add two columns:

Rank Flag = RANKX('Table',[Total each Retailer],,ASC,Dense) *10+
RANKX(FILTER('Table',[Total each Retailer]=EARLIER('Table'[Total each Retailer])),[RETAILER_NAME],,ASC,Dense)
Final Rank = RANKX('Table',[Rank Flag],,ASC,Dense)

Output:

Eyelyn9_0-1659516013709.png

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ashish_Mathur
Super User
Super User

Hi,

Share data in format that can be pasted in an MS Excel file.  On that data, please also show the expected result very clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur ,

 

This what I want to achieve with Power BI

 

pravkan_0-1657625902337.png

 

I have a table called V_BOTTOM_SALES and I want to create a measure that will rank my bottom n retailer with their product subcategory.

 

I don't know if this is possible in dax?

Please read my previous post.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
ryan_mayu
Super User
Super User

@pravkan 

you can try this

Table 2 = 
VAR tbl=TOPN(3,'Table','Table'[sales],ASC)
return SELECTCOLUMNS(tbl,"retailer",'Table'[Retiler_name],"product",'Table'[product],"sales",'Table'[sales])

pls see the attachment below

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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