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,133 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
0 answers

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

What are some practical examples of how ...READ MORE

Dec 27, 2024 in Power BI by Evanjalin
• 9,780 points
43 views
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,140 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,362 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
826 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,527 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,203 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,029 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,177 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,620 points
1,759 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