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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
abhijit_vetal
Frequent Visitor

Extract specific rows from table based on dynamic slicer selection

I have 3 columns Activity period, fiscal period and gross_profit having monthly data .I have activity period on slicer. Now I want to show gross profit of next two fiscal period months. I am not getting how can I approach it I have tried using dateadd function but not getting expected result also tried using calculate function I am still not getting what is expected, please help me I am new to Power BI community

(note-Gross profit is a measure)

On selecting slicer (Activity period= may 2021)

input:

Activity periodFiscal periodGross profit
may 2021april 2021333
may 2021may 20214303
may 2021june 20213340
may 2021july 2021-1112
may 2021august  2021230

 

output:

Activity periodFiscal period Gross profit
may 2021april 2021 
may 2021may 2021 
may 2021june 2021 3340
may 2021 july 2021-1112
may 2021august  2021 

 

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

Hi, @abhijit_vetal 

You can try the following steps:

1.create a saperate calculated table

 

Slicer = DISTINCT('Table'[Fiscal period]) 

 

2.add a new measure to replace the value of measure[M_Gross profit]

 

M_result = 
IF (
    DATEDIFF (
        MAX ( Slicer[Fiscal period] ),
        MAX ( 'Table'[Fiscal period] ),
        MONTH
    )
        IN { 1, 2 },
    [M_Gross profit],
    BLANK ()
)

 

170.png

 

Best Regards,
Community Support Team _ Eason
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

3 REPLIES 3
v-easonf-msft
Community Support
Community Support

Hi, @abhijit_vetal 

You can try the following steps:

1.create a saperate calculated table

 

Slicer = DISTINCT('Table'[Fiscal period]) 

 

2.add a new measure to replace the value of measure[M_Gross profit]

 

M_result = 
IF (
    DATEDIFF (
        MAX ( Slicer[Fiscal period] ),
        MAX ( 'Table'[Fiscal period] ),
        MONTH
    )
        IN { 1, 2 },
    [M_Gross profit],
    BLANK ()
)

 

170.png

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Thank you so much for Solving my problem Really apreciated. Keep doing great work for community

abhijit_vetal
Frequent Visitor

@amitchandak @AlexisOlson @TheoC  can you help please

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.