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
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
Super User
Super User

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
Super User
Super User

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
Super User
Super User

@ATTAR 

You may try this approach with two filter  tables

https://youtu.be/TufnsAxJsjs

tamerj1
Super User
Super User

@ATTAR 

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

tamerj1
Super User
Super User

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