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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
BIdileepku
Frequent Visitor

undefined

Hi we are migrating Tableau to power bi here i am facing one issue while migrating

BIdileepku_0-1748506747584.png

BIdileepku_1-1748506904916.pngBIdileepku_2-1748506914743.png

 

the screen short is from tableau  i need to implement same in power bi
Years, Quarters, months, weeks ,days, Hours, Minutes
for all this we have sub filters like previous year, last years .... so on for all 
can any one help how can we implement this in power bi

1 ACCEPTED SOLUTION
pankajnamekar25
Super User
Super User

Step 1: Create a Disconnected Table for Time Units

You’ll need a slicer like:

Time Granularity

Years

Quarters

Months

Weeks

Days

Hours

Minutes

Create a table like this (either manually or via Power Query):TimeGranularity = DATATABLE(

    "Granularity", STRING,

    {

        {"Years"},

        {"Quarters"},

        {"Months"},

        {"Weeks"},

        {"Days"},

        {"Hours"},

        {"Minutes"}

    }

)

 

Step 2: Create Another Table for Relative Selection

RelativeOption

Previous

 

 

 

RelativeSelection = DATATABLE(

    "Selection", STRING,

    {

        {"Previous"},

        {"This"},

        {"Next"},

        {"To Date"}

    }

)

 

Step 3: Create Numeric Input Table for “Last/Next N”

This table lets users choose N = 1 to 10 (or more):

NTable = GENERATESERIES(1, 10, 1)

 

Step 4: Use These as Disconnected Slicers

Put TimeGranularity, RelativeSelection, and NTable as slicers on your report. They will drive logic in your DAX, not directly filter your date table.

 

Step 5: Create a Measure or Calculated Table to Filter Dates Based on Selection

You need a DAX measure that uses selected values from these slicers to compute a dynamic date range:

SelectedGranularity = SELECTEDVALUE(TimeGranularity[Granularity])

SelectedOption = SELECTEDVALUE(RelativeSelection[Selection])

SelectedN = SELECTEDVALUE(NTable[Value])

TodayDate = TODAY()

 

 

Then, based on combinations like

SWITCH(TRUE(),

    SelectedGranularity = "Months" && SelectedOption = "Previous",

        TodayDate >= EOMONTH(TodayDate, -SelectedN) + 1

        && TodayDate <= EOMONTH(TodayDate, -1),

       

    SelectedGranularity = "Months" && SelectedOption = "This",

        TodayDate >= DATE(YEAR(TodayDate), MONTH(TodayDate), 1)

        && TodayDate <= EOMONTH(TodayDate, 0),

 

    -- Add similar logic for Quarters, Weeks, Years, etc.

)

 

 

Thanks,
 Pankaj Namekar | LinkedIn

If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

View solution in original post

4 REPLIES 4
v-bmanikante
Community Support
Community Support

Hi @BIdileepku ,

 

Thank you for reaching out to Microsoft Fabric Community Forum.

@pankajnamekar25 Thank you for your quick response.

 

We would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.

 

If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

 

Please don't forget to give a "Kudos vbmanikante_0-1748785555930.png" – I’d truly appreciate it!

 

Regards,

B Manikanteswara Reddy

Hi @BIdileepku ,

 

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?

If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.

 

Please don't forget to give a "Kudos vbmanikante_0-1749058587253.png" – I’d truly appreciate it!

 

Regards,

B Manikanteswara Reddy

Hi @BIdileepku ,

 

Thank you for reaching out to Microsoft Fabric Community Forum.

As we haven’t heard back from you, we will go ahead and close this ticket for now.

If you need any further assistance, please don’t hesitate to raise a new ticket, we’re always happy to help.

Our sincere apologies if there was any inconvenience caused.

 

Regards,

B Manikanteswara Reddy

pankajnamekar25
Super User
Super User

Step 1: Create a Disconnected Table for Time Units

You’ll need a slicer like:

Time Granularity

Years

Quarters

Months

Weeks

Days

Hours

Minutes

Create a table like this (either manually or via Power Query):TimeGranularity = DATATABLE(

    "Granularity", STRING,

    {

        {"Years"},

        {"Quarters"},

        {"Months"},

        {"Weeks"},

        {"Days"},

        {"Hours"},

        {"Minutes"}

    }

)

 

Step 2: Create Another Table for Relative Selection

RelativeOption

Previous

 

 

 

RelativeSelection = DATATABLE(

    "Selection", STRING,

    {

        {"Previous"},

        {"This"},

        {"Next"},

        {"To Date"}

    }

)

 

Step 3: Create Numeric Input Table for “Last/Next N”

This table lets users choose N = 1 to 10 (or more):

NTable = GENERATESERIES(1, 10, 1)

 

Step 4: Use These as Disconnected Slicers

Put TimeGranularity, RelativeSelection, and NTable as slicers on your report. They will drive logic in your DAX, not directly filter your date table.

 

Step 5: Create a Measure or Calculated Table to Filter Dates Based on Selection

You need a DAX measure that uses selected values from these slicers to compute a dynamic date range:

SelectedGranularity = SELECTEDVALUE(TimeGranularity[Granularity])

SelectedOption = SELECTEDVALUE(RelativeSelection[Selection])

SelectedN = SELECTEDVALUE(NTable[Value])

TodayDate = TODAY()

 

 

Then, based on combinations like

SWITCH(TRUE(),

    SelectedGranularity = "Months" && SelectedOption = "Previous",

        TodayDate >= EOMONTH(TodayDate, -SelectedN) + 1

        && TodayDate <= EOMONTH(TodayDate, -1),

       

    SelectedGranularity = "Months" && SelectedOption = "This",

        TodayDate >= DATE(YEAR(TodayDate), MONTH(TodayDate), 1)

        && TodayDate <= EOMONTH(TodayDate, 0),

 

    -- Add similar logic for Quarters, Weeks, Years, etc.

)

 

 

Thanks,
 Pankaj Namekar | LinkedIn

If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors