Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
4 years ago
Solved

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

  • 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

2 Replies

  • 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

  • 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.