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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
MarioJoseb1980
Frequent Visitor

Creating a table with filtered values using a date from and date to

Hi this is not working for me. I am creating a table using this dax: 

EventosFiltrados =
FILTER('Eventos Agosto',
       'Eventos Agosto'[Fecha Inicio Evento] <= [SelectedDate]  &&  'Eventos Agosto'[Fecha Fin Evento] >= [SelectedDate]  
      )  
 
My [SelectedDate]  is a selectevalue from another table. This measure works fine: 
SelectedDate = SELECTEDVALUE('100 Horas Críticas SIN 2023'[Fecha Hora])
 
Please HELPPP!!!
1 ACCEPTED SOLUTION
Anonymous
Not applicable

hi @MarioJoseb1980 ,
I delete the relationship and edit the DAX formula.

 

Filter_date = 
VAR dat = SELECTEDVALUE('100 HORAS CRITI'[Date])
VAR hou = SELECTEDVALUE('100 HORAS CRITI'[Hour])
VAR filter_dat = FILTER('Event_Table', 'Event_Table'[Start Date] <= dat && 'Event_Table'[Start Hour] <= hou && 'Event_Table'[End Date] >= dat && 'Event_Table'[End Hour] >= hou)
RETURN
CALCULATE(SUM('Event_Table'[Generation reserve]), filter_dat)

 

The result is shown below.

vjiewumsft_0-1711352622124.png

 

You need to be a super user to attach files on messages.

Solved: How to upload PBI in Community - Microsoft Fabric Community

 

Best Regards,

Wisdom Wu

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

7 REPLIES 7
MarioJoseb1980
Frequent Visitor

This issue is not solved yet, how can I attach the .pbix here?

Anonymous
Not applicable

Hi @MarioJoseb1980 ,

Please try the following methods and check if they can solve your problem:

1.Create the simple table.

vjiewumsft_0-1710470050358.png

2.Create the new measure to select date and hour.

 

SELECTDATE = SELECTEDVALUE('100 HORAS CRITI'[Date])
Selectedhour = SELECTEDVALUE('100 HORAS CRITI'[Hour])

 

3.Create the new measure to filter values.

 

Filter_date = 
VAR dat = [SELECTDATE]
VAR hou = [Selectedhour]
VAR filter_dat = FILTER('Event_Table', 'Event_Table'[Start Date] <= dat && 'Event_Table'[Start Hour] <= hou && 'Event_Table'[End Date] >= dat && 'Event_Table'[End Hour] >= hou)
RETURN
CALCULATE(SUM('Event_Table'[Generation reserve]), filter_dat)

 

4.Drag the measure into the table visual. The result is shown below.

vjiewumsft_1-1710470120565.png

 

Best Regards,

Wisdom Wu

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

 

 

 

What I want to return is a table in the right side with the list of the events contained in the date and hour from the right side. 

I converted all the dates in short dates using format (for testing purposes) and did the following, but it didn't work: 

EventosFiltrados =
var shortDate = [SelectedDate]
var shortTime = [SelectedHour]
var filter1 = FILTER('Eventos Agosto',
       'Eventos Agosto'[FechaInicioCorta] <= shortDate && 'Eventos Agosto'[FechaFinCorta] >= shortDate  
      )      
return CALCULATETABLE('Eventos Agosto',filter1)
Anonymous
Not applicable

hi @MarioJoseb1980 ,
I delete the relationship and edit the DAX formula.

 

Filter_date = 
VAR dat = SELECTEDVALUE('100 HORAS CRITI'[Date])
VAR hou = SELECTEDVALUE('100 HORAS CRITI'[Hour])
VAR filter_dat = FILTER('Event_Table', 'Event_Table'[Start Date] <= dat && 'Event_Table'[Start Hour] <= hou && 'Event_Table'[End Date] >= dat && 'Event_Table'[End Hour] >= hou)
RETURN
CALCULATE(SUM('Event_Table'[Generation reserve]), filter_dat)

 

The result is shown below.

vjiewumsft_0-1711352622124.png

 

You need to be a super user to attach files on messages.

Solved: How to upload PBI in Community - Microsoft Fabric Community

 

Best Regards,

Wisdom Wu

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

 

Another important thing: both tables "100 Horas Criticas" and "Eventos Agosto" doesn't have a relationship. In your example you are creating a relationship between them, which is not the current situation.

 

 

don't know how to attach here the pbix file. 😞 

MarioJoseb1980
Frequent Visitor

MarioJoseb1980_0-1710460865328.png

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.