cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ADDHOPE
Frequent Visitor

how to return the value for the selected item in power bi dax and show it as new record

Hello All,

 

I have similar structure as below tables. (The sample data is as below. Both table are connected on ItemID)

 

ADDHOPE_1-1670101936185.pngorder Data

ADDHOPE_2-1670101954670.png repair data

 

 

 

I have to now find out the ID which have different sales country and different repair country. I can do that easily for 1st repair country by this formula. (As I have manually calculated the index based on the repair date)

Solved: Re: how to find the second value for the selected ... - Microsoft Power BI Community

FYI: Explanation on calculating Index. @v-yuezhe-msft 

1st Repair = CALCULATE(COUNT('Table1'[ItemID],'Table2'[RepairCountry] <> SELECTEDVALUE('Table1'[SalesCountry]))

But now I have to find get all the ID which have different repair country than sales country. i.e. I want to get those IDs as well if the 2nd or 3rd repair countries are not matching.

 

So the table should list all the ItemID where the Repair country does not match the sales country irrespective of the instance, where it happened in 3rd or 2nd.

 

Can you please help 

 

 

 

Regards,

1 ACCEPTED SOLUTION
VijayP
Super User
Super User

@ADDHOPE 

In this file I have done the poc for you. But still I could not understand only 2 records you are expecting where as 4 records are mismatching ! watch the video and you can understand my question!

https://drive.google.com/file/d/1jkip32jrS-WZHN6_DkE6afDbFynv4RnA/view?usp=share_link




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


View solution in original post

3 REPLIES 3
VijayP
Super User
Super User

@ADDHOPE 

In this file I have done the poc for you. But still I could not understand only 2 records you are expecting where as 4 records are mismatching ! watch the video and you can understand my question!

https://drive.google.com/file/d/1jkip32jrS-WZHN6_DkE6afDbFynv4RnA/view?usp=share_link




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


VijayP
Super User
Super User

@ADDHOPE 

To make it more clear ,can you add a snapshot of what is your final out come should look like. It helps us to answer the question with more accurate thought




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Hello Vijay, @VijayP 

 

It should look like this. 

This list the ItemID details where the original sales country does not match the repair country.

ADDHOPE_0-1670165065868.png

The challenge I have is to look through the all repair data of Item and identify at those records which have different sale country and different repair country.

 

Hope this helps 🙂 

Regards,

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.