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
zakkyang
Frequent Visitor

Dynamicly Select Values Based on Multiple Measures

I know it might be difficult to understand the title here...

 

To illustrate, I have multiple products that will be  re-launched in different countries and brands under one big group.

For example, Product A and Product B will be re-launched in a batch under brand a in Brazil while Product C and D will be launched under other brands in other countries some day. What I mean re-launch is that previously these products were already there, it is just like a modification of existing products with seemless time series.

 

So we can use the re-launch date as Day0, and the first day after re-launch will be Day1, and the day before the re-launch day will be Day-1, etc.

The data schema is like this:

 

Batch NumberBrandProduct NameCalendar_DateRe-Launch DateDays Since ReLaunchedSales
Brand A - 2021-03-04Brand AProduct A2021-03-032021-03-04-1100
Brand A - 2021-03-04Brand AProduct A2021-03-042021-03-040200
Brand A - 2021-03-04Brand AProduct A2021-03-052021-03-041300
Brand A - 2021-03-04Brand AProduct B2021-03-032021-03-04-1120
Brand A - 2021-03-04Brand AProduct B2021-03-042021-03-040300
Brand A - 2021-03-04Brand AProduct B2021-03-052021-03-041350

To evaluate the impact of the post-relaunch period vs previous period. I created a table using the function of 

 

GENERATESERIES(-180, 180, 1)

 

And I created a measure using

 

SELECTEDVALUE('Days Since Switched Period'[Days Number])

 

 Then I link this column in the model to Days Since ReLaunched so that if I use slider to change the Days Number, everything will be changed.


The expected outcome is that we can evaluate the pre and post lift rate in sales.

 

As you can see below, it seems the post launch is not ideal when the day range is between -180 and +180 days. Howver, it is not true as some of the products for example just re-launched in just 17 days but it has a history of almost 1 year before the relaunch. So the pre period is summed up which makes the pre period much larger than the post period. Do you have any idea how to remove those products that they have not achieved the max selected day number? Thanks.

zakkyang_0-1648236824889.png

 

 

 

 

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @zakkyang ,

 

Please try the following formula and show items when the measure is not blank.

 

Measure = 
VAR tab =
    FILTER (
        ALLSELECTED ( 'Table' ),
        'Table'[Product Name] = MAX ( 'Table'[Product Name] )
    )
VAR Precount =
    MINX ( tab, 'Table'[Days Since ReLaunched] )
VAR Aftcount =
    MAXX ( tab, 'Table'[Days Since ReLaunched] )
RETURN
    IF ( Precount = -1 * Aftcount, 1 )

vkkfmsft_0-1648548002128.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-kkf-msft
Community Support
Community Support

Hi @zakkyang ,

 

Please try the following formula and show items when the measure is not blank.

 

Measure = 
VAR tab =
    FILTER (
        ALLSELECTED ( 'Table' ),
        'Table'[Product Name] = MAX ( 'Table'[Product Name] )
    )
VAR Precount =
    MINX ( tab, 'Table'[Days Since ReLaunched] )
VAR Aftcount =
    MAXX ( tab, 'Table'[Days Since ReLaunched] )
RETURN
    IF ( Precount = -1 * Aftcount, 1 )

vkkfmsft_0-1648548002128.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

"Then I link this column in the model"

 

Which column ?  From the Generateseries table?

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