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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Rygaard
Resolver I
Resolver I

Calculate less than selectedvalue (CALCULATE(['Actual],'G/L Account'[A.No]<SELECTEDVALUE()

The problem:

CM1=CALCULATE(['Actual],'G/L Account'[A.No]<SELECTEDVALUE(Ark1[konto]))   - NOT workding
CM1=CALCULATE(['Actual],'G/L Account'[A.No]<21000) - Working

 

 

I have a messure that works just fine:

CM1=CALCULATE(['Actual],'G/L Account'[A.No]<21000)

and another
CM2=CALCULATE(['Actual],'G/L Account'[A.No]<27000)
 
instead of making cm1, cm2, Ebit, Ebitda, and and so on i wanted it dynamic so i made  a table
NAME KONTO
Cm1  21000
cm2   27000
Ebit   50000
EBITDA  45000
......
 
if i make a slicer and select CM1   and write a measure like
Selected Account= SELECTEDVALUE(Ark1[konto])    and stick that on  a Card i get 21.000  - Perfect
 
But if i try to use that as a filter it wont work
 
CM1=CALCULATE(['Actual],'G/L Account'[A.No]<SELECTEDVALUE(Ark1[konto]))   - NOT workding
CM1=CALCULATE(['Actual],'G/L Account'[A.No]<21000) - Working
 
i get the error :" A functil ' SELECTEDVALUE' has been used in a True/false expression, that is used as a table filter expression, this is not allowed."
 
Any sugestions on how to make this work ?
 
 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Rygaard , Try like

 

CM1=CALCULATE([Actual],filter('G/L Account','G/L Account'[A.No]<SELECTEDVALUE(Ark1[konto])))

 

or

 

CM1=
var _1 = SELECTEDVALUE(Ark1[konto])
return
CALCULATE([Actual],filter('G/L Account','G/L Account'[A.No]<_1))

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Rygaard , Try like

 

CM1=CALCULATE([Actual],filter('G/L Account','G/L Account'[A.No]<SELECTEDVALUE(Ark1[konto])))

 

or

 

CM1=
var _1 = SELECTEDVALUE(Ark1[konto])
return
CALCULATE([Actual],filter('G/L Account','G/L Account'[A.No]<_1))

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

#imstupid  the main reason it did not work was ofc. that i made a connection between my selection table and the Acount table -  witch ofc applyed the selection across all calculations.. after i removed that it worked as it should... 

@amitchandak 

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.