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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
ATTAR
Frequent Visitor

2 what-if parameter connected using generateseries

Hello all,

I am trying to connect two parameters to each other. 

The first one is called "Day" as it contains day range from 1 to 31.

The second one is called "Index" and should be connected to the "Day" parameter with the following logic as shown in the screenshot. 

ATTAR_0-1654783915235.png

For example :

  • If the Day parameter is set on 15 which is higher than 9 (as in 9 June) then my range would start from -12 to -1 

  • If the Day parameter is set on 3 which is lower than 9 (as in 9 June) then my range would start from -13 to -2

Please find in attachment the pbix sample file. 

 

Can you help me solve it ? 

Many thanks.

@Greg_Deckler  @amitchandak @Ashish_Mathur 

Abdoullah 

1 ACCEPTED SOLUTION
tamerj1
Community Champion
Community Champion

Hi @ATTAR 
Another way of doing that is as follows https://we.tl/t-rEUCEmyA59

3.png1.png2.png

Index = 
GENERATE (
    Parameter,
    VAR CurrntValue = Parameter[Parameter]
    VAR DayOfToday = DAY ( TODAY ( ) )
    VAR IndexStart = IF ( CurrntValue <= DayOfToday, -13, -12 )
    VAR IndexEnd = IF ( CurrntValue <= DayOfToday, -2, -1 )
    RETURN 
        GENERATESERIES ( IndexStart, IndexEnd, 1 )
)

View solution in original post

5 REPLIES 5
tamerj1
Community Champion
Community Champion

Hi @ATTAR 
Another way of doing that is as follows https://we.tl/t-rEUCEmyA59

3.png1.png2.png

Index = 
GENERATE (
    Parameter,
    VAR CurrntValue = Parameter[Parameter]
    VAR DayOfToday = DAY ( TODAY ( ) )
    VAR IndexStart = IF ( CurrntValue <= DayOfToday, -13, -12 )
    VAR IndexEnd = IF ( CurrntValue <= DayOfToday, -2, -1 )
    RETURN 
        GENERATESERIES ( IndexStart, IndexEnd, 1 )
)
tamerj1
Community Champion
Community Champion

@ATTAR 

You may try this approach with two filter  tables

https://youtu.be/TufnsAxJsjs

tamerj1
Community Champion
Community Champion

@ATTAR 

Tables cannot read the filter context. Ot won't automatically update on selection 

tamerj1
Community Champion
Community Champion

@ATTAR 

Do you need to add this index as a column? Then how does the table look like?

ATTAR
Frequent Visitor

@tamerj1 
Not as a column but as slicer. 

Will be linked later with a DIM_Calendar table based on the values. 

ATTAR_0-1654785231650.png

ATTAR_1-1654785260547.png

 

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.