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 9, 2019 in Power BI by Gloria
• 160 points
2,188 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
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
• 33,030 points
19,217 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
• 33,030 points
1,399 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
• 33,030 points
7,038 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,620 points
858 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,220 points

edited Oct 11, 2018 by Kalgi 2,612 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
• 52,350 points
1,235 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 23, 2019 in Power BI by VNK
19,099 views
0 votes
1 answer

What are some practical examples of how Power BI Copilot can assist with building DAX measures and queries?

Power BI Copilot can make building DAX ...READ MORE

answered Dec 27, 2024 in Power BI by pooja
• 12,450 points
77 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
• 52,350 points
3,223 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP