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, 2019 in Power BI by Gloria
• 160 points
252 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, 2019 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, 2019 in Power BI by Cherukuri
• 32,460 points
6,334 views
0 votes
1 answer

Calculate and filter function - DAX

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

answered May 2, 2019 in Power BI by Cherukuri
• 32,460 points
182 views
0 votes
1 answer

all and allExcept - DAX functions

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

answered May 7, 2019 in Power BI by Cherukuri
• 32,460 points
832 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
1,085 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,590 points
100 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,200 points

edited Oct 11, 2018 by Kalgi 479 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
• 51,850 points
204 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, 2019 in Power BI by VNK
13,485 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
• 51,850 points
584 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, 2019 in Power BI by Upasana
• 8,590 points
191 views