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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
munder1978
Frequent Visitor

date from filter

HI guys
i have a formula in dax that i need add the last and the start date from the filter (date) in the report that the user defined, is possible this?

munder1978_0-1637856251897.png

the filter in the report use "fecha correcta" but i need use the start and end date selection that the user define to pull the data from "fecha T"

 

thanks and regards

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @munder1978 ,

Here are the steps you can follow:

1. Create measure.

all_amount =
SUMX(ALL('Table'),'Table'[Precio])
min_Date =
MIN('Table'[Fecha Correcta])
min_Date =
MIN('Table'[Fecha Correcta])

2. Use Smart narrative visual objects.

vyangliumsft_0-1638322068301.png

3. In the dialog box that appears, write down the text first, and click +Value to find the corresponding measure

vyangliumsft_1-1638322068304.jpeg

4. Result:

vyangliumsft_2-1638322068306.png

 

Best Regards,

Liu Yang

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

5 REPLIES 5
Anonymous
Not applicable

Hi  @munder1978 ,

Here are the steps you can follow:

1. Create measure.

all_amount =
SUMX(ALL('Table'),'Table'[Precio])
min_Date =
MIN('Table'[Fecha Correcta])
min_Date =
MIN('Table'[Fecha Correcta])

2. Use Smart narrative visual objects.

vyangliumsft_0-1638322068301.png

3. In the dialog box that appears, write down the text first, and click +Value to find the corresponding measure

vyangliumsft_1-1638322068304.jpeg

4. Result:

vyangliumsft_2-1638322068306.png

 

Best Regards,

Liu Yang

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

Anonymous
Not applicable

Hi  @munder1978 ,

I created some data:

vyangliumsft_0-1638152882292.png

Here are the steps you can follow:

You can use [Fecha Correcta] as a slicer, select two values as the maximum and minimum.

Using the min() and max() functions to obtain the maximum and minimum values of the slicer.

1. Create measure.

Measure =
var _min=MIN('Table'[Fecha Correcta])
var _max=MAX('Table'[Fecha Correcta])
return
CALCULATE(SUM('Table'[amount]),FILTER(ALL('Table'),'Table'[Fecha T]>=_min&&'Table'[Fecha T]<=_max))

2. Result:

vyangliumsft_1-1638152882302.png

Best Regards,

Liu Yang

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

Hola Liu Yang

something like that is what I need but it does not give me the right value, create a more detailed vision to see if you can help me

munder1978_0-1638199837263.png

Thanks a lot

amitchandak
Super User
Super User

@munder1978 ,  If you have joined a date table or use a filter/slicer from the same table it will filter automatically

 

else you need to create a measure and add it in visual. Do for all measures OR filter measure for non blank at visual level

 

 

measure =
var _max = maxx(allselected('Date'),'Date'[Date])
var _min = minx(allselected('Date'),'Date'[Date])

return

countrows(filter(Table, Table[Date]>=_min && Table[Date] <=_max))

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks amitchandack is work in a part, but i need to know the date min and max, and with this i have the number off day in period, for example if the user filter the report between 1-1-2021 and 2-2-2021, i need the mesure show me this 2 date like min and max and with that i can use in the formula.

 

thanks and reagards

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

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