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
ry22749
Frequent Visitor

First Date in a Slicer Filter Meassure

Hello, I started using Power BI one month ago. I am really happy with this community.

 

I have the "Real" column. I want to compare each value with the value of 1/12/2018.

Tabla.JPG

The meassure I created is this one:

Medida.JPG 

Now, I added a slicer, so I want to compare each value with the first value on the Slicer. When I create a meassure that takes the min value of "Fecha" I get an error message. How can I solve this?

 MiN.JPG

Slicer.JPG 

 

 

Thank you very much for your help-

 

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @ry22749 

The below should do the trick.

Measure = 
VAR f = CALCULATE(
    MIN(Pautas_Macro[Fecha]);
    ALLSELECTED()
)
RETURN 
CALCULATE(
    SUM(Pautas_Macro[Real]);
    Pautas_Macro[Fecha] = f
) 


Regards,
Mariusz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Mariusz
Community Champion
Community Champion

Hi @ry22749 

The below should do the trick.

Measure = 
VAR f = CALCULATE(
    MIN(Pautas_Macro[Fecha]);
    ALLSELECTED()
)
RETURN 
CALCULATE(
    SUM(Pautas_Macro[Real]);
    Pautas_Macro[Fecha] = f
) 


Regards,
Mariusz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@MariuszWorked! Thank you!!

Anonymous
Not applicable

@ry22749 - 

You could use a variable to store the MIN value and then use it, like this:

Medida 2 = 
var min_date = MIN(Pautas_Macro[Fecha])
return CALCULATE(SUM(Pautas_Macro[Real]); Pautas_Macro[Fecha] = min_date)

Hope this helps,

Nathan

 

@Anonymous Thanks for your help! But that meassure gives this: ("Medida3")

Tabla2.JPG

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.