Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi and Happy New Year 2024 to the Community.
Here is my issue: I want to display a bar chart with 2023 values
1- if the "Year" filter does not have any selection, display chart using Measure #1 (only 2023 values)
2- if the "Year" filter has a selected valye, than use Measure #2 (values conditioned by filter selection)
Thank you for your help.
Solved! Go to Solution.
Hi, @JMSNYC
Based on your description, I have created many measures to achieve the effect you are looking for. Following picture shows the effect of the display.
Measures:
AppearDataByYear =
VAR _slicer_count =
DISTINCTCOUNT ( 'Slicer'[Year] )
VAR _all_count =
COUNTROWS ( ALL ( 'Slicer' ) )
VAR _selcet_years =
ALLSELECTED ( 'Slicer'[Year] )
VAR _max_year =
CALCULATE ( MAX ( 'Table'[Year] ), ALL () )
VAR _filter =
SWITCH (
TRUE (),
_slicer_count = _all_count, IF ( SELECTEDVALUE ( 'Table'[Year] ) = _max_year, 1 ),
_slicer_count < _all_count, IF ( SELECTEDVALUE ( 'Table'[Year] ) IN _selcet_years, 1 )
)
RETURN
_filter
If this does not work, could you please share some sample data without sensitive information and expected output.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi, @JMSNYC
Based on your description, I have created many measures to achieve the effect you are looking for. Following picture shows the effect of the display.
Measures:
AppearDataByYear =
VAR _slicer_count =
DISTINCTCOUNT ( 'Slicer'[Year] )
VAR _all_count =
COUNTROWS ( ALL ( 'Slicer' ) )
VAR _selcet_years =
ALLSELECTED ( 'Slicer'[Year] )
VAR _max_year =
CALCULATE ( MAX ( 'Table'[Year] ), ALL () )
VAR _filter =
SWITCH (
TRUE (),
_slicer_count = _all_count, IF ( SELECTEDVALUE ( 'Table'[Year] ) = _max_year, 1 ),
_slicer_count < _all_count, IF ( SELECTEDVALUE ( 'Table'[Year] ) IN _selcet_years, 1 )
)
RETURN
_filter
If this does not work, could you please share some sample data without sensitive information and expected output.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 24 | |
| 12 | |
| 11 | |
| 9 | |
| 8 |