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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
singh_gagan03
Frequent Visitor

DAX Requirement || Help

Hi All,

 

I am facing a problem in writing DAX for the scenario explained below, need help asap. The Data Source is Excel Worksheet.

 

Visuals on page: 2 slicers (country and item) and matrix visuals 

 

In the image, the yellow column is the desired result.

 

Scenario 1 Please check the image below and in the particular matrix visual I have Item, Country, Value, Volume, and Price. I need to find the minimum price for an item across the countries and the name of the country giving that minimum price.

 

Scenario 2 Please check the image below and now I am changing the country selections in the slicers and item slicer kept as it is now the minimum price for an item should change according to the country selections and the name of the country minimum price should also be updated.

 

Scenario 3 Please check the image below and now I am changing the item and the country selections are kept as it is now the minimum price for an item should change according to the country selections and the name of the country minimum price should also be updated.

 

Please help me writing a DAX for the below scenarios, it would be great if we can connect for the explanation of the DAX as well and TIA in advance. 

 

 
 

image.png

 

 

 

2 REPLIES 2
wdx223_Daniel
Super User
Super User

@singh_gagan03 

Min Price=CALCULATE(MIN(Table[Price]),ALLEXCEPT(Table,Table[Item]),ALLSELECTED(Table[Country]))

Country With Min Price=CONCATENATEX(TOPN(1,CALCULATETABLE(Table,ALLEXCEPT(Table,Table[Item]),ALLSELECTED(Table[Country])),CALCULATE(MIN(Table[Price])),ASC),Table[Country],",")

HI @wdx223_Daniel ,

 

I have implemented the min price DAX but the result I am getting is not aligned as per the image I shared with you. The DAX you have shared with me is giving me the minimum value as same across slicer selections.

 

For example in scenario 1 the DAX for Item 1 it is returning me min price as 33.33 and country as C1 for all selections which are correct but when I make the selection as Country = C2, C3 then the min price should be 100, and the country now be C2.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors