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

ความคิดเห็น • 54

  • @PiyushKumar-tv6dr
    @PiyushKumar-tv6dr 6 หลายเดือนก่อน +2

    Rank = RANK(DENSE,ALL('Table'),ORDERBY('Table'[Population],DESC),,PARTITIONBY('Table'[State]))

  • @biswadeepsahoo
    @biswadeepsahoo ปีที่แล้ว +2

    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.

  • @sachingunjal7347
    @sachingunjal7347 ปีที่แล้ว +1

    simple way out usig Rank
    Rank using RANK =
    RANK(
    DENSE
    , All('Table 6')
    , ORDERBY([Total Population],DESC)
    ,, PARTITIONBY('Table 6'[State])
    )

  • @rajeshmedapalli7026
    @rajeshmedapalli7026 11 หลายเดือนก่อน +1

    This measure also works as Same
    Final_Rank = RANKX(ALLSELECTED('Table 6'[State]),[Total Population],,DESC,Dense)

    • @learnwidgiggs
      @learnwidgiggs  11 หลายเดือนก่อน

      Great 👍

    • @challanaveen1014
      @challanaveen1014 10 หลายเดือนก่อน

      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.

    • @anupamjha827
      @anupamjha827 6 หลายเดือนก่อน

      This doesn’t work all expect work

    • @anupamjha827
      @anupamjha827 6 หลายเดือนก่อน

      @@challanaveen1014this work if we put only customer also

  • @tushargogiya4017
    @tushargogiya4017 ปีที่แล้ว +1

    Column =
    var groupi='Table'[STATE]
    var _model=CALCULATETABLE('Table',FILTER('Table','Table'[STATE]=groupi))
    return RANKX(_model,'Table'[PRICE],,ASC)

  • @prashantawasthi8842
    @prashantawasthi8842 9 หลายเดือนก่อน +2

    rank = RANKX(CALCULATETABLE(test,ALLEXCEPT(test,test[state])),[tot],,DESC)

  • @Powerhealth96
    @Powerhealth96 ปีที่แล้ว +1

    Fabric +copilot can impact the role power bi and advantages disadvantage you can explain it will be helpful

  • @sanuatul3959
    @sanuatul3959 ปีที่แล้ว

    Rank based on multiple columns means 3 to 4 columns. How we will do that

  • @challanaveen1014
    @challanaveen1014 10 หลายเดือนก่อน +2

    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

  • @trikavyam8101
    @trikavyam8101 ปีที่แล้ว +1

    Hi sir,can we use earlier function as a measure to rank ..

  • @prekshasharma1216
    @prekshasharma1216 ปีที่แล้ว

    Fantastic, Thankyou for explaining it well

  • @saifulislam-xq9wh
    @saifulislam-xq9wh 9 หลายเดือนก่อน

    sir please provide the data source so that we can practice

  • @rajm5349
    @rajm5349 ปีที่แล้ว

    hi sir , i have a small doubt here why the state is showing two different values for single state(chennai--700,4000)

  • @ashu60071
    @ashu60071 ปีที่แล้ว

    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.

  • @sridharamanisomarajugajula6721
    @sridharamanisomarajugajula6721 11 หลายเดือนก่อน

    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!

  • @pravallikam9777
    @pravallikam9777 ปีที่แล้ว

    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?

  • @sivaranjaniprasanna
    @sivaranjaniprasanna ปีที่แล้ว

    I'm new to dax. Kindly provide me the roadmap to study dax and what are all the resources to use

  • @Mahesh717
    @Mahesh717 ปีที่แล้ว +1

    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 ?

  • @namrataghosh111
    @namrataghosh111 ปีที่แล้ว

    Really helpful scenario once again

  • @ragnarlodhbrok1684
    @ragnarlodhbrok1684 9 หลายเดือนก่อน

    final_rk=RankX(filter(table,table[state]=earlier(table[state])),table[population],desc,,dense)
    do you think this would work

  • @anugyasinghal1998
    @anugyasinghal1998 ปีที่แล้ว

    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?

    • @learnwidgiggs
      @learnwidgiggs  ปีที่แล้ว

      Try to resolve this yourself..you will learn something new by doing this

  • @krishnakantapanda6835
    @krishnakantapanda6835 10 หลายเดือนก่อน

    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
    )

  • @shreyoshiraychaudhary8808
    @shreyoshiraychaudhary8808 ปีที่แล้ว

    What is [Total Population]?

    • @shreyoshiraychaudhary8808
      @shreyoshiraychaudhary8808 ปีที่แล้ว

      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?

  • @shaheerbaba-0082
    @shaheerbaba-0082 5 หลายเดือนก่อน

    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

  • @arshithak6237
    @arshithak6237 ปีที่แล้ว

    cant we use this formula Rank= RANKX(CROSS JOIN(ALL([State]),ALL([Population])),[Population],,Desc)

    • @learnwidgiggs
      @learnwidgiggs  ปีที่แล้ว

      Try it out and then let us know the outcome

  • @MeCrator
    @MeCrator 11 หลายเดือนก่อน

    max function is giving a different value

  • @kalyanamchakrawarty5093
    @kalyanamchakrawarty5093 ปีที่แล้ว

    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.

    • @learnwidgiggs
      @learnwidgiggs  ปีที่แล้ว

      You can book 1 slot first..then if queries complete nhi hoti hn to..you can book another session.

  • @adityabidkar9395
    @adityabidkar9395 7 หลายเดือนก่อน

    New Column=RANKX(FILTER(ALL(Sales),Sales[State] =EARLIER(Sales[State])),Sales[Population],,DESC,Dense)

  • @SunilKumar-yx7fb
    @SunilKumar-yx7fb ปีที่แล้ว

    Iam trying to use simple rankx but it is giving 1 for all.. what could b the error??

    • @learnwidgiggs
      @learnwidgiggs  ปีที่แล้ว

      Plz try to ..debug properly
      I have shown everything step by step in the video..plz watch it again

    • @SunilKumar-yx7fb
      @SunilKumar-yx7fb ปีที่แล้ว

      @@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

    • @learnwidgiggs
      @learnwidgiggs  ปีที่แล้ว

      @@SunilKumar-yx7fb It can be I believe

  • @salmanulfariskp7232
    @salmanulfariskp7232 6 หลายเดือนก่อน

    From my side
    Rank =
    RANKX(
    ALLSELECTED('Table'[customer]),
    [Total_Population],
    ,DESC,Dense
    )

  • @yuvrajdalal9184
    @yuvrajdalal9184 ปีที่แล้ว +1

    ROWNUMBER(ALL('Table6'),ORDERBY([Population],DESC),LAST,PARTITIONBY([State]))
    you can try this..

  • @rashmipatil-c6b
    @rashmipatil-c6b 3 หลายเดือนก่อน

    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