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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Andrew_pbi
New Member

Show data only if item exists in all the selected years

Hello Community, I am new to powerbi (trying to learn DAX) and have been faced with a scenario to calculate and display the total sales value based on the highest value of the years selected.
So in the report we have a multi select year slicer (used from Year field in the data source). There is a bar garph that shows the sum of values from "Total" filed against Region and Rep and Item hierarchy.

Now, the request is to display the graph for the items (display in the Region/Rep/Item hierarchy level) that are common with the years that are all selected in the slicer. Would it be posible to achive this?

Please can someone help me with the DAX to achieve this.

 

RegionRepItemUnitsUnit CostTotalYear
EastJonesPencil95             1.99       189.052022
CentralKivellBinder50          19.99       999.502021
CentralJardinePencil36             4.99       179.642021
CentralGillPen27          19.99       539.732025
WestSorvinoPencil56             2.99       167.442024
EastJonesBinder60             4.99       299.402020
CentralAndrewsPencil75             1.99       149.252024
CentralJardinePencil90             4.99       449.102024
WestThompsonPencil32             1.99          63.682025
EastJonesBinder60             8.99       539.402025
CentralMorganPencil90             4.99       449.102024
EastHowardBinder29             1.99          57.712024
EastParentBinder81          19.99    1,619.192022
EastJonesPencil35             4.99       174.652020
CentralSmithDesk2        125.00       250.002023
EastJonesPen Set16          15.99       255.842021
CentralMorganBinder28             8.99       251.722021
EastJonesPen64             8.99       575.362020
EastParentPen15          19.99       299.852020
CentralKivellPen Set96             4.99       479.042025
CentralSmithPencil67             1.29          86.432020
EastParentPen Set74          15.99    1,183.262020
CentralGillBinder46             8.99       413.542021
CentralSmithBinder87          15.00    1,305.002022
EastJonesBinder4             4.99          19.962023
WestSorvinoBinder7          19.99       139.932023
CentralJardinePen Set50             4.99       249.502022
CentralAndrewsPencil66             1.99       131.342023
EastHowardPen96             4.99       479.042021
CentralGillPencil53             1.29          68.372024
1 REPLY 1
SamInogic
Super User
Super User

Hi @Andrew_pbi ,

 

As per our understanding, you want the graph to display items count based on Year, Region and Rep hierarchy. So, you can try below configuration with “Area Chart” type of visual (or can use any other chart as required) on the Power BI report.

 

Add X-axis properties with columns as Year, Region, Rep and Y-Axis as Count of Item

 

Please refer to the below screenshot for the same.

SamInogic_0-1688455148899.png


Let us know if your expected output in case the required output is different than this.

 

Thanks!

Inogic Professional Services Division

Power Platform and Microsoft Dynamics 365 CRM Development – All under one roof!

Drop an email at crm@inogic.com

Services:  http://www.inogic.com/services/

Power Platform/Dynamics 365 CRM Tips and Tricks:  http://www.inogic.com/blog/

Inogic Professional Services: Power Platform/Dynamics 365 CRM
An expert technical extension for your techno-functional business needs
Service: https://www.inogic.com/services/
Tips and Tricks: https://www.inogic.com/blog/

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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