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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Rayito169
Frequent Visitor

Know value of filter to apply in calculate column

Hello,

My name is Javi and I am starting to use power Bi in my company.

I have a doubt with apply a value of filter in a if sentence.

e1.PNG

This is my filter and I need to know its text value ( LRP1,LRP2,..) to use in a if sentence.

In this moment, I have it:

e3.PNG

And I use it in a if:

e4.PNG

It is a If sentence to calculate difference sums depends on FILTRO LRP value but I have an error.

Could I help me?

 

Many thanks.

 

1 ACCEPTED SOLUTION
v-haibl-msft
Employee
Employee

@Rayito169

 

You can try to create measures with following formulas.

 

FILTRO_LRP =
    IF ( HASONEVALUE ( Tipos[nombre] ), VALUES ( Tipos[nombre] ) )
LRP1 =
IF ( [FILTRO_LRP] = "LRP1", 1, 2 )

Know value of filter to apply in calculate column_1.jpg

 

Best Regards,

Herbert

View solution in original post

4 REPLIES 4
v-haibl-msft
Employee
Employee

@Rayito169

 

You can try to create measures with following formulas.

 

FILTRO_LRP =
    IF ( HASONEVALUE ( Tipos[nombre] ), VALUES ( Tipos[nombre] ) )
LRP1 =
IF ( [FILTRO_LRP] = "LRP1", 1, 2 )

Know value of filter to apply in calculate column_1.jpg

 

Best Regards,

Herbert

It´s work. Thank you very much to all.

BhaveshPatel
Community Champion
Community Champion

YOU SHOULD USE "ALLSELECTED" or "HASONEVALUE" function to get the value of slicer.

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

I am trying this but it does not work

EVI.PNG

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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