The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
How can I show 4 Quartals back data only on chart based on slicer. Other visuals should show what is selected in slicer.
Goal: If I select 2020 Q1, then on chart I want to see 2021 Q1, Q2, Q3 and 2022 Q1.
When I select 2021 Q3 I want to see 2020 Q4 and 2021 Q1 Q2 Q3.
But only chart should be affected like this.
Thanks.
Solved! Go to Solution.
Hi @aaldo_666 ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want. Assume that you have a year quarter dimension table as below, then you can create a measure as below:
Measure =
VAR _selyear =
SELECTEDVALUE ( 'YearQuarter'[Year] )
VAR _selquarter =
SELECTEDVALUE ( 'YearQuarter'[Quarter] )
VAR _qnum =
VALUE ( RIGHT ( _selquarter, 1 ) )
RETURN
CALCULATE (
SUM ( 'Table'[Sales amount] ),
FILTER (
'Table',
IF (
_qnum = 4,
'Table'[Year] = _selyear
&& VALUE ( RIGHT ( 'Table'[Quarter], 1 ) ) >= 1
&& VALUE ( RIGHT ( 'Table'[Quarter], 1 ) ) <= 4,
(
'Table'[Year] = _selyear
&& VALUE ( RIGHT ( 'Table'[Quarter], 1 ) ) >= 1
&& VALUE ( RIGHT ( 'Table'[Quarter], 1 ) ) <= _qnum
)
|| (
'Table'[Year] = _selyear - 1
&& VALUE ( RIGHT ( 'Table'[Quarter], 1 ) ) >= _qnum + 1
&& VALUE ( RIGHT ( 'Table'[Quarter], 1 ) ) <= 4
)
)
)
)
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Hi @aaldo_666 ,
You can also refer the following links to get it.
Show previous 6 months of data from single slicer selection
Best Regards
Hi @aaldo_666 ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want. Assume that you have a year quarter dimension table as below, then you can create a measure as below:
Measure =
VAR _selyear =
SELECTEDVALUE ( 'YearQuarter'[Year] )
VAR _selquarter =
SELECTEDVALUE ( 'YearQuarter'[Quarter] )
VAR _qnum =
VALUE ( RIGHT ( _selquarter, 1 ) )
RETURN
CALCULATE (
SUM ( 'Table'[Sales amount] ),
FILTER (
'Table',
IF (
_qnum = 4,
'Table'[Year] = _selyear
&& VALUE ( RIGHT ( 'Table'[Quarter], 1 ) ) >= 1
&& VALUE ( RIGHT ( 'Table'[Quarter], 1 ) ) <= 4,
(
'Table'[Year] = _selyear
&& VALUE ( RIGHT ( 'Table'[Quarter], 1 ) ) >= 1
&& VALUE ( RIGHT ( 'Table'[Quarter], 1 ) ) <= _qnum
)
|| (
'Table'[Year] = _selyear - 1
&& VALUE ( RIGHT ( 'Table'[Quarter], 1 ) ) >= _qnum + 1
&& VALUE ( RIGHT ( 'Table'[Quarter], 1 ) ) <= 4
)
)
)
)
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
13 | |
2 | |
1 | |
1 | |
1 |
User | Count |
---|---|
16 | |
12 | |
3 | |
2 | |
2 |