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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Need DAX help

This is an silly issue but really i need help. I am trying to convert below to display records and rank wise but while converting it's throwing error. But it's working fine when i browse the tabular cube and write the query.

evaluate
ADDCOLUMNS(test, "Rank", countrows(FILTER (TEST,[Paid_Amount]>=EARLIER([PAID_AMOUNT]) )
)
)

Ranking = ADDCOLUMNS('Fact Claim',"Rank",COUNTROWS(FILTER('Fact Claim',[Paid Amount]>=[Paid Amount])))
issue.PNG
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi Paid Amount isMeasure in my model.

Paid Amount:=sum('Fact Claim'[Paid Original Amount]). when i am trying to use inside of earlier Paid Amount not listed.

Other way which you are provided i ahve tried same measure but it's throwing me an error.conversa.PNG

 

View solution in original post

8 REPLIES 8
v-gizhi-msft
Community Support
Community Support

Hi,

 

I think in your original formula before converted, the [Paid Amount] is a column but not a measure, so maybe you can try this:

Ranking = 
ADDCOLUMNS (
    'Fact Claim',
    "Rank", COUNTROWS (
        FILTER (
            'Fact Claim',
            'Fact Claim'[Patient Paid Amount]
                >= EARLIER ( 'Fact Claim'[Patient Paid Amount] )
        )
    )
)

The result shows:

3.PNG

See my attached pbix file.

 

Best Regards,

Giotto

Anonymous
Not applicable

Hi Paid Amount isMeasure in my model.

Paid Amount:=sum('Fact Claim'[Paid Original Amount]). when i am trying to use inside of earlier Paid Amount not listed.

Other way which you are provided i ahve tried same measure but it's throwing me an error.conversa.PNG

 

amitchandak
Super User
Super User

@Anonymous , You can use min or max and create an earlier kind of formula in measure. But row context/group by is missing in this

 

Ranking = ADDCOLUMNS('Fact Claim',"Rank",COUNTROWS(FILTER('Fact Claim',[Paid Amount]>=min([Paid Amount]))))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Still getting issue while using min.I think so arithematic functions will not work tabular model source.

issue.PNG

az38
Community Champion
Community Champion

@Anonymous 

your Paid AMount is a measure

try to use SELECTEDVALUE() instead of MIN()


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Hi, I am trying to use measure in selected value but am not getting measure into the list. is there any other way i can write.

issue.PNG

Pragati11
Super User
Super User

Hi @Anonymous ,

 

The following DAX is missing EARLIER function in the highlighted section:

Ranking = ADDCOLUMNS('Fact Claim',"Rank",COUNTROWS(FILTER('Fact Claim',[Paid Amount]>=[Paid Amount])))

 

Try writing it as:

Ranking = ADDCOLUMNS(

                                           'Fact Claim',"Rank",COUNTROWS(

                                                                                                 FILTER(

                                                                                                            'Fact Claim',[Paid Amount]>=EARLIER([Paid Amount])

                                                                                                            )

                                                                                                )

                                           )

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

 

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Hi, Earlier is used with calucalted columns not with measures so that is the reason am not using earlier.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors