Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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]) )
)
)
Solved! Go to Solution.
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.
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:
See my attached pbix file.
Best Regards,
Giotto
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.
@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]))))
Still getting issue while using min.I think so arithematic functions will not work tabular model source.
@Anonymous
your Paid AMount is a measure
try to use SELECTEDVALUE() instead of MIN()
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.
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
Hi, Earlier is used with calucalted columns not with measures so that is the reason am not using earlier.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.