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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

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

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

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
Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors