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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Sammy22
Helper I
Helper I

Periods parameter for user flexibility

Hello,

 

I have a report which currently has set periods, P1 is 2023 and P2 is 2024. Users want to be able to change the date ranges of these periods, for example, they may want to look at the first half of 2022 vs 2023. Below is an example of how i would want this to work.

 

Sammy22_0-1725290190011.png

I have tried to follow the below process. I can create 2 calendar tables, 2 date paramters however, i cannot 'bind to parameter'. This isn't visible. Appreciate the help.

 

Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn

1 ACCEPTED SOLUTION
Irwan
Super User
Super User

hello @Sammy22 

 

the best way is using filter pane as mentioned by @lbendlin .

 

if you want tricky way, here is an example of what i did for my project.

1. create a duplicate table of your original table, something like this.

Table 2 = 'Table'
2. create P1 and P2 measure which P1 takes value from original table and P2 takes value from duplicated table.
P1 = 
IF(
    ISFILTERED('Table'),
    SUM('Table'[Orders])
)
P2 = 
IF(
    ISFILTERED('Table 2'),
    SUM('Table 2'[Orders])
)
3. plot your slicer and measure. similarly as above, slicer 1 from original table and slicer 2 from duplicated table.
Irwan_0-1725321985861.png

 

Hope this will help.

Thank you.

View solution in original post

8 REPLIES 8
Irwan
Super User
Super User

hello @Sammy22 

 

the best way is using filter pane as mentioned by @lbendlin .

 

if you want tricky way, here is an example of what i did for my project.

1. create a duplicate table of your original table, something like this.

Table 2 = 'Table'
2. create P1 and P2 measure which P1 takes value from original table and P2 takes value from duplicated table.
P1 = 
IF(
    ISFILTERED('Table'),
    SUM('Table'[Orders])
)
P2 = 
IF(
    ISFILTERED('Table 2'),
    SUM('Table 2'[Orders])
)
3. plot your slicer and measure. similarly as above, slicer 1 from original table and slicer 2 from duplicated table.
Irwan_0-1725321985861.png

 

Hope this will help.

Thank you.

thanks for your help! What if i also want to group by a field that exists in both tables. If i select a field from Table 1 then the orders will be broken down for Table 1 (P1) only and Table 2 (p2) Orders will just show a total.

hello @Sammy22 

 

i might be misunderstood but if you mean by "group by a field" is calculation result from selecting field, then you can add your field as filter so it will calculate each of those fields.

 

something like this, calculate(sum('Table'[Orders]),filter(allselected('Table'),'Table[Field]=.....))

 

otherwise, please share your sample data and your desired outcome.

 

Thank you.

Thanks for your help. It would be like the below where there are can be up to 40 different countries. I would be summing up the orders by country by period.

Sammy22_0-1725458268402.png

 

hello @Sammy22 

 

to do this, you need to define relationship since P1 and P2 will be group into same country category.

 

1. create a new table with following DAX.

Country = SUMMARIZE('Table','Table'[Country])
Irwan_0-1725497613145.png

 

2. create a relationship between the new table and P1 tbl and P2 tbl
Irwan_1-1725497649942.png

 

3. add country value from the new table (not country from table P1 and table P2).

Irwan_2-1725497720091.png

 

4. change P1 and P2 DAX into this DAX if you want to make those blank value into zero. This is basically same DAX with additional if statement for zeroing blank value.

P1 = 
var _Value =
IF(
    ISFILTERED('Table'),
    SUM('Table'[Orders])
)
Return
IF(
    ISBLANK(_Value),
    0,
    _Value
)
P2 = 
var _Value =
IF(
    ISFILTERED('Table 2'[Date]),
    SUM('Table 2'[Orders])
)
Return
IF(
    ISBLANK(_Value),
    0,
    _Value
)
 
Hope this will help.
Thank you.
lbendlin
Super User
Super User

For maximum flexibility use the Filter Pane and teach your users how to operate it.

Are you able to share more details? What do you mean by the filter pane?

This one

 

lbendlin_0-1726061109152.png

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors