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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
nicolast29
Helper V
Helper V

selectedvalues in Excel PowerPivot

https://1drv.ms/u/s!AoqtZHsX4Bzvg_gO4DA7tR5F5XABhw?e=GEeEAy 

 

Hi

I have made a calculated column a table (Balance) in order to recover a information from another table in my bi report, it work great ...

 

 

catégorie PCG = 
Var Compte_Pcg ='Balance'[Compte]
Var fouchette_correspondante =FILTER(fourchettes, Compte_Pcg>=fourchettes[Début] && Compte_Pcg <= fourchettes[Fin])
return
CALCULATE(SELECTEDVALUE(fourchettes[Catégorie]),fouchette_correspondante)

 

 

 

but at the end the user wanted it only in Excel, so I try to transform it but selectedvalues is missing

I have made a lot of try with for example with  IF ( HASONEVALUE ( Table[column] ), VALUES ( Table[column] ) ), but it always ended with error

There is something that i does missandertand i think

 

I put in attached file the pbix (cc.pbix) and the Excel file (cc.xlsb)

 

 

Thanks a lot for helping

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@nicolast29 , You need to some expression to return one value there like max , try

 

catégorie PCG =
Var Compte_Pcg ='Balance'[Compte]
Var fouchette_correspondante =FILTER(fourchettes, Compte_Pcg>=fourchettes[Début] && Compte_Pcg <= fourchettes[Fin])
return
CALCULATE(max(fourchettes[Catégorie]),fouchette_correspondante)

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@nicolast29 , You need to some expression to return one value there like max , try

 

catégorie PCG =
Var Compte_Pcg ='Balance'[Compte]
Var fouchette_correspondante =FILTER(fourchettes, Compte_Pcg>=fourchettes[Début] && Compte_Pcg <= fourchettes[Fin])
return
CALCULATE(max(fourchettes[Catégorie]),fouchette_correspondante)

thanks a lot

It works

If i understant, whitout the max it return a table who is a problem, but with the max it return a single value and that it ?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors