Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
ankurshah01
Frequent Visitor

Get month value where rank = 1 from another Table

Hi All, 

 

I have a table that shows below data. 

Table A

CalmonthRank1Volume
Jan-23440
Feb-23150
Mar-23245
Apr-23634
May-23920
Jun-23825
Jul-23536
Aug-23730
Sep-231010
Oct-23118
Nov-23342

Rank1 is a measure.

Now based on above table, i need to get the Calmonth value where Rank1 = 1 in Table B. 

So in this case i will get Feb 2023. 

 

I created a new column in Table B & tried using Calculate with max & filter (where rank = 1) but it returns always Nov 2023. 

New Column = CALCULATE(max('Table A'[Calmonth]),FILTER('Table A', 'Table A'[Rank1] = 1))

I tried with different options using Lookup or selectedvalue but not getting required output. 

 

how to resolve this issue? 

 

Regards

Ankur

 

 

1 ACCEPTED SOLUTION

Hi, @ankurshah01 

kindly update your 
my rank measure is below

Measure =
  RANK(
    DENSE,
    ALL('Table'[volume]),
    ORDERBY('Table'[volume],DESC)
  )

 

and 

column dax is below

Column = 
 CALCULATE(
   MIN('Table'[calmonth]),
   FILTER('Table',[Measure]=1)
 )

 

 

 

above is work for me 
when i use rankx() instead of Rank() i got error like circular dependency detect 

rank1 = 
RANKX(ALL('Table'[volume]),'Table'[volume],MIN('Table'[volume]))

 

Dangar332_0-1703138913017.png

 

so update your rank code if it made from rankx()

View solution in original post

7 REPLIES 7
Dangar332
Super User
Super User

HI, @ankurshah01 

try below code for column

 

New Column = 
  CALCULATE(
      'Table A'[Calmonth],
       FILTER(
           all('Table A'[rank]),
           'Table A'[Rank1] = 1
       )
  )

 

Hi, 

Above code is not working since, after calculate there needs to be an expression. 

Regards

Ankur

Hi, @ankurshah01 

 

Can you clarify What problem you face?

Hi @Dangar332 , 


CALCULATE(
      'Table A'[Calmonth],
       FILTER(
I am not able to input above highlighted table & field after calculate.
It is only showing me Rank & Volume fields. 

 

Regards

Ankur

Hi, @ankurshah01 

@ankurshah01 

 

New Column = 

Var a = 'Table A'[Calmonth]

Return 

  CALCULATE( a,

           'Table A'[Rank1] = 1

       )

  

Or 

New column=

Minx(

       FILTER(

           'Table A',

           'Table A'[Rank1] = 1

       ),

 'Table A'[Calmonth]

)

 

 

Hi @Dangar332 , 

 

New Column = 

Var a = 'Table A'[Calmonth]

Return 

  CALCULATE( a,

           'Table A'[Rank1] = 1

       )

Above code is giving me -- >> 

A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table filter expression. This is not allowed.

 

Below code is giving me value as Jan 2023 as output -- 

New column=

Minx(

       FILTER(

           'Table A',

           'Table A'[Rank1] = 1

       ),

 'Table A'[Calmonth]

)

 

Regards

Ankur

Hi, @ankurshah01 

kindly update your 
my rank measure is below

Measure =
  RANK(
    DENSE,
    ALL('Table'[volume]),
    ORDERBY('Table'[volume],DESC)
  )

 

and 

column dax is below

Column = 
 CALCULATE(
   MIN('Table'[calmonth]),
   FILTER('Table',[Measure]=1)
 )

 

 

 

above is work for me 
when i use rankx() instead of Rank() i got error like circular dependency detect 

rank1 = 
RANKX(ALL('Table'[volume]),'Table'[volume],MIN('Table'[volume]))

 

Dangar332_0-1703138913017.png

 

so update your rank code if it made from rankx()

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.