Scenario: Rank on the basis of 2 Columns | Power BI Interview
ฝัง
- เผยแพร่เมื่อ 7 ก.พ. 2025
- Codebasics Data Analyst Bootcamp Link: codebasics.io/...
Topmate Link to book call 1:1 - topmate.io/lea...
Link for the Scenario based QnA in Power BI: • Scenario based QnA - P...
Link for the Power Bi Interview QnA playlist :
• Power BI Interview QnA
Link for the SQL QnA playlist :
• SQL Interview QnA for ...
Link for the Data Warehousing QnA playlist :
• DW Concepts Based QnA
Your queries:
power bi interview questions
power bi interview questions and answers
power bi interview
power bi interview questions for experienced professionals
power bi interview questions for freshers
deloitte power bi interview questions
power bi scenario based interview questions
power bi service interview questions
scenario based power bi interview questions
power bi practice scenarios
power bi real time scenarios
shashank singh power bi
power bi scenario based questions
sql and power bi interview questions
capgemini power bi interview questions
accenture power bi interview questions
power bi managerial round interview questions
how to explain project in power bi interview
power bi roadmap
power bi jobs for freshers
power bi project explanation in interview
power bi resume for freshers
power bi fresher jobs
power bi resume
power bi developer resume
power bi resume for 2 years experience india
power bi developer resume for experienced
#powerbiinterview
#learnwidgiggs
Rank = RANK(DENSE,ALL('Table'),ORDERBY('Table'[Population],DESC),,PARTITIONBY('Table'[State]))
I have use simple RANKX(ALL('Table'[Customer),[Total Population]) it gives the rank of all customer. Then I just add the state column and it just filtered the Rank within the states just like your result.
Please advise why I need to use this lengthy DAX function which you showing.
that's right
simple way out usig Rank
Rank using RANK =
RANK(
DENSE
, All('Table 6')
, ORDERBY([Total Population],DESC)
,, PARTITIONBY('Table 6'[State])
)
It's helpful
This measure also works as Same
Final_Rank = RANKX(ALLSELECTED('Table 6'[State]),[Total Population],,DESC,Dense)
Great 👍
the above will not work.....
Answer-:
final rank=RankX(allselected(Table6[customer],table6[state]),[Total population],Desc,Dense)
the above query will ignore filter context of name and state and gives complete ranks based on Totalpopulation, we can put slicer for state and see individual ranks state wise.
This doesn’t work all expect work
@@challanaveen1014this work if we put only customer also
Column =
var groupi='Table'[STATE]
var _model=CALCULATETABLE('Table',FILTER('Table','Table'[STATE]=groupi))
return RANKX(_model,'Table'[PRICE],,ASC)
rank = RANKX(CALCULATETABLE(test,ALLEXCEPT(test,test[state])),[tot],,DESC)
Fabric +copilot can impact the role power bi and advantages disadvantage you can explain it will be helpful
Noted.
Rank based on multiple columns means 3 to 4 columns. How we will do that
simply we can get the same output by simple rankx formula directly
ranks = rankx(all(customername),[totalpupulation])
here we are not ignoring state column so will get ranks by state
Hi sir,can we use earlier function as a measure to rank ..
Yes here you could use it too.
Thank u sir
Fantastic, Thankyou for explaining it well
Welcome 😊
sir please provide the data source so that we can practice
hi sir , i have a small doubt here why the state is showing two different values for single state(chennai--700,4000)
Hi people
I have downloaded new version of power bi where time intelligence function is'nt working. I have checked the options in file ribbon --> options and settings but the figures are not reflecting report. can you help me please.
why are we using first variable i.e max_state instead of writing RANKX(FILTER(ALL('Table'),'Table'[State]='Table'[State]), Can you please let me know the reason behind it & also why are we using Total Population measure, can't we use sum(population) directly in rankx function? will be helpful to understand this video if you answer this. Thank you!
he;s making it complicated
Sir I have a doubt why we should not have many to relationships in one of your videos I saw that it gives ambiguous results ? What is ambiguous results? ....can you please explain.....what problem do we face if we have many to many relationship?
I'm new to dax. Kindly provide me the roadmap to study dax and what are all the resources to use
sir, 🙋🙋🙋
I have used this method :-
Rank =
Rankx(CrossJoin
(All(Table(customer]),
(All(Table(State]),
(All(Table(Population])),
[total population],, Desc,Dense)
=> output
population 5000 = 1
population 4000 = 2
population 2500 = 3
population 1500 = 4
population 1000 = 5
population 900 = 6
population 700 = 7
population 500 = 8
Is this correct ?
It looks correct.
Really helpful scenario once again
Welcome 😊
final_rk=RankX(filter(table,table[state]=earlier(table[state])),table[population],desc,,dense)
do you think this would work
Hello Sir, thank you for this insightful video.
I tried this question with the data and every time there is a error comes "circular dependency is detected" could you explain, why is this happening?
Try to resolve this yourself..you will learn something new by doing this
I made use of the below dax-
Rank_Test=
RankX(
'Table 6',
Calculate (
Sum(
'Table 6'[Population]),
AllExcept(
'Table 6',
'Table 6'[state]
),
DESC,
DENSE
)
What is [Total Population]?
Hi, I have a confusion. The thing is if and when I use RankxDemo =
Var state = MAX(RankxDemo[city])
Return RANKX(FILTER(All(RankxDemo),'RankxDemo'[city] = state),SUM(RankxDemo[population]),,DESC,Dense), I get 1.
But when I use RankxDemo =
Var state = MAX(RankxDemo[city])
Return RANKX(FILTER(All(RankxDemo),'RankxDemo'[city] = state),[Total Population],,DESC,Dense), given [Total Population] = sum('Tab'[population]), it works. Can you please explain why?
rank =
var max_state=MAX('Sheet1'[State])
var final_rank=RANKX(FILTER(ALL('Sheet1'),'Sheet1'[State]=max_state),[Total_population],,DESC,Dense)
return final_rank
I am using same dax u ues bro but i am getting error: A circular dependency was detected: Sheet1[Final_Rank].help me to resolve it
its working thank you
cant we use this formula Rank= RANKX(CROSS JOIN(ALL([State]),ALL([Population])),[Population],,Desc)
Try it out and then let us know the outcome
max function is giving a different value
Sir mai 1 to 1 conversations karna chahta hu , regarding for my resume, interview preparation aur job se too sir mereko sabka alag alag subscription lena padega.
You can book 1 slot first..then if queries complete nhi hoti hn to..you can book another session.
New Column=RANKX(FILTER(ALL(Sales),Sales[State] =EARLIER(Sales[State])),Sales[Population],,DESC,Dense)
Iam trying to use simple rankx but it is giving 1 for all.. what could b the error??
Plz try to ..debug properly
I have shown everything step by step in the video..plz watch it again
@@learnwidgiggs Rank = RANKX(ALL (EMPBILLSUM[BILL CLAIMED BY]),[TotalBills], ,DESC)
I dont see any syntax error or other issue. There 3 columns in the table. Is there any restriction on data types
@@SunilKumar-yx7fb It can be I believe
From my side
Rank =
RANKX(
ALLSELECTED('Table'[customer]),
[Total_Population],
,DESC,Dense
)
ROWNUMBER(ALL('Table6'),ORDERBY([Population],DESC),LAST,PARTITIONBY([State]))
you can try this..
Thanks for the solution.
State Rank =
RANKX(
ALL('table 6'[state]), [ total population], , DESC ) OR
RANKX(ALLSELECTED('table 6'[state]), [total population], , DESC)----- we need to use external slicer for states
@learnwidgiigs which is correct sir please let me know