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
Syndicate_Admin
Administrator
Administrator

Filter data in a table by date range from two different data segments

I have a "Mexus" table with a dataset, with a date column.

manchaos44_0-1654287292123.png

Then I have created two tables, which have the different possible dates that can be selected.

Calendar_Init = DISTINCT(
MEXUS[month]
)
Calendar_End = DISTINCT(
MEXUS[month]
)
That I show them in the form like this
manchaos44_1-1654287378551.png

What I need is to filter the nexus table data between what is selected in Month 1 and what is selected in Month 2

Movements = where month1 = SELECTEDVALUE(Calendar_Init[MONTH])
where month2 = SELECTEDVALUE(Calendar_End[MONTH])
return FILTER(MEXUS; MEXUS[type]<> "baseline" && MEXUS[MONTH] >= month1 && MEXUS[MONTH] <= month2)
But it goes blank and I can't show the information.
manchaos44_2-1654288128913.png

It is not worth making a range on the same table, since other things are broken.

I leave a pbix example to see if someone can help me. Thank you!!

https://1drv.ms/u/s!AiHOzTzu7U3IgZA21zE7DwDoq4rtEg

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Syndicate_Admin , These two tables should not join with your tables

 

You can create measure not table or calculated column

 

new measure

 

Movements =
var _min = minx(allselected(Calendar_Init), Calendar_Init[MONTH])
var _max = maxx(allselected(Calendar_End), Calendar_End[MONTH])

return
calculate(Sum(Table[CPU]), FILTER(MEXUS, MEXUS[type]<> "baseline" && MEXUS[MONTH] >= _min && MEXUS[MONTH] <= _max))

 

 

Select data between months - Month Range Slicer: https://youtu.be/nEt7dT3Tfv4

View solution in original post

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Although it has not served me 100% for what I wanted to achieve, it has served as a basis to be able to do it. Thank you very much for your help.

amitchandak
Super User
Super User

@Syndicate_Admin , These two tables should not join with your tables

 

You can create measure not table or calculated column

 

new measure

 

Movements =
var _min = minx(allselected(Calendar_Init), Calendar_Init[MONTH])
var _max = maxx(allselected(Calendar_End), Calendar_End[MONTH])

return
calculate(Sum(Table[CPU]), FILTER(MEXUS, MEXUS[type]<> "baseline" && MEXUS[MONTH] >= _min && MEXUS[MONTH] <= _max))

 

 

Select data between months - Month Range Slicer: https://youtu.be/nEt7dT3Tfv4

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.