Forum Discussion
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 period | Fiscal period | Gross profit |
| may 2021 | april 2021 | 333 |
| may 2021 | may 2021 | 4303 |
| may 2021 | june 2021 | 3340 |
| may 2021 | july 2021 | -1112 |
| may 2021 | august 2021 | 230 |
output:
| Activity period | Fiscal period | Gross profit |
| may 2021 | april 2021 | |
| may 2021 | may 2021 | |
| may 2021 | june 2021 | 3340 |
| may 2021 | july 2021 | -1112 |
| may 2021 | august 2021 |
Hi, Anonymous
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 () )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.
3 Replies
- v-easonf-msftCommunity Support
Hi, Anonymous
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 () )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.- AnonymousNot applicable
Thank you so much for Solving my problem Really apreciated. Keep doing great work for community
- AnonymousNot applicable
amitchandak AlexisOlson TheoC can you help please