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
Gokan
Frequent Visitor

lookupvalue & filtered column

Hey there,

 

i'm newby with power bi, i need your help with dax,

 

i have two different tables;

 

* Sales table (includes all of cities, months, regions)

* Employee table (some employees responsible with 3 cities and two regions for example)

Here is the screenshot of data;

Gokan_0-1601479398431.png


here is the second table;

 

Gokan_1-1601479507522.png

 

 

as you can see, i've made an id month + brick.

and the second table has same id as well.

 

i want to lookup a medicine that sold in that month and that brick.

something like;

 

ABIZOL TABS 5 MG 28 = LOOKUPVALUE('Satışlar'[Net_Kutu],'Satışlar'[Ürün],"ABIZOL TABS 50 MG 28",'Satışlar'[Ay_Brick],Rep[Ay_Brick])

 

in this formula i'm trying to filter "a medicine" using same ids (ay_brick) and want to get sales number.

 

really thanks for your help.

3 REPLIES 3
v-yingjl
Community Support
Community Support

Hi @Gokan ,

Based on your description, did these tables have any relationship? Not certain what did the same Ay & brick column in the two tables represent.

If possible, could you please consider sharing a simple dummy sample file for further discussion so that we could help you better.

Please see this post regarding How to Get Your Question Answered Quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Best Regards,
Yingjie Li

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Gokan , Try new column in Table 1

new column = sumx(filter(Table2, Table2[Ay_brick] =Table1[Ay_brick]),Table2[net sales])

or

new column = sumx(filter(Table2, Table2[Ay_brick] =Table1[Ay_brick] && Table2[Ay] =Table1[Ay]),Table2[net sales])

Thanks but no luck,

 

Because in your solution there is no "medicine name", i want to get specific medicine net sales.

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.