MDX and DAX Queries

+2 votes
1. How do i Write an MDX query to obtain top 3 companies based on the revenue generated.

2. How do i Write a DAX query to obtain the bottom 5 customers based on the order price.
Oct 8 in Power BI by Gloria
• 140 points
130 views

1 answer to this question.

+1 vote

Hi Gloria,

Use TopCount() function to return the top n records.

For Example - 

SELECT [Measures].[Revenue] ON 0,
TOPCOUNT([hierarchy ]... [company name], 3, [Measures].[Revenue])
ON 1
FROM [table name]
answered Oct 9 by raksha
Thanks, @Raksha, I have upvoted your answer.

Related Questions In Power BI

0 votes
1 answer

How to calculate cumulative Total and % in DAX?

Hi, If your table is ready with percentage ...READ MORE

answered Mar 18 in Power BI by Cherukuri
• 32,260 points
2,588 views
0 votes
1 answer

Calculate and filter function - DAX

Hi Praneeth, Calculate () by default perform calculations ...READ MORE

answered May 2 in Power BI by Cherukuri
• 32,260 points
52 views
0 votes
1 answer

all and allExcept - DAX functions

Hi Satish, All function is used when you ...READ MORE

answered May 7 in Power BI by Cherukuri
• 32,260 points
343 views
+1 vote
1 answer

Unable to install connector for Power Bi and PostgreSQL

I think the problem is not at ...READ MORE

answered Aug 21, 2018 in Power BI by nirvana
• 3,060 points
800 views
0 votes
1 answer

Calculate Time Intersection to Correlate Sequences of Independent Events

I think this solution requires a CROSS JOIN implementation. ...READ MORE

answered Oct 26, 2018 in Power BI by Upasana
• 8,570 points
59 views
+3 votes
2 answers

Combine tables in Power BI

You can also achieve this using a ...READ MORE

answered Oct 5, 2018 in Power BI by lina
• 8,160 points

edited Oct 11, 2018 by Kalgi 241 views
0 votes
1 answer

Power Bi Dax Table

You need to wrap the numbers in ...READ MORE

answered Oct 5, 2018 in Power BI by Kalgi
• 46,110 points
117 views
0 votes
2 answers

Power BI Dax Multiple IF AND Statements

HI I have Column Patient 12 13 14 15 18 IN Patient=12, 13 Out ...READ MORE

answered May 22 in Power BI by VNK
9,740 views
0 votes
1 answer

Power BI DAX expression more than 2 or conditon

Heyyy @Hannah, you just need remove or ([principlecode] = ...READ MORE

answered Oct 29, 2018 in Power BI by Kalgi
• 46,110 points
303 views
0 votes
1 answer

Power Query : Adding Columns and Multiple files

The following call, FirstRowAsHeader = Table.PromoteHeaders(TableWithoutHeader) shall replace the ...READ MORE

answered Feb 14 in Power BI by Upasana
• 8,570 points
40 views