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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

how to get split column values based on the another table conditions

 I having two table    both sheet gave a common value Market code 

  1.mergedsheet 

  2.Monthly rep

 

 Merged sheet have values filed actauls   

 

mergedsheet 

KEY               MARKETCODE      ACTAULS 

1A04                  FS                        450

2A04                  KS                        450

3A04                  LS                        450

4A04                  0S                        450

 

Monthly rep

KEY               MARKETCODE        DS/NONDS

1A04                  FS                        DS

2A04                  KS                        NONDS

3A04                  LS                        DS

4A04                  0S                        NONDS

 

now i want split mergesheet table  based on the monthly rep[Ds/NONDS]  . monthly rep market value  matched rows with  ds condtions in  monthly rep  its  split new column 

mergedsheet 

KEY               MARKETCODE          DS         NONDS

1A04                  FS                        450           0

2A04                  KS                           0          450

3A04                  LS                        450            0

4A04                  0S                          0            450

 

i tired  lookup value  with filter context not working. any idea .

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Anonymous You could use a Merge query in Power Query to do this probably. For DAX columns, try:

DS Column =
  VAR __Key = [KEY]
  VAR __Market = [MARKETCODE]
  VAR __DSNDS = MAXX(FILTER('Monthly rep',[KEY]=__Key && [MARKETCODE]=__Market),[DS/NONDS])
RETURN
  IF(__DSNDS = "DS",[ACTAULS],0)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

@Anonymous You could use a Merge query in Power Query to do this probably. For DAX columns, try:

DS Column =
  VAR __Key = [KEY]
  VAR __Market = [MARKETCODE]
  VAR __DSNDS = MAXX(FILTER('Monthly rep',[KEY]=__Key && [MARKETCODE]=__Market),[DS/NONDS])
RETURN
  IF(__DSNDS = "DS",[ACTAULS],0)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler  tired this measure but i am getting error  DAX comparison operations do not support comparing values of type Text with values of type Integer. Consider using the VALUE or FORMAT function to convert one of the values.

@Anonymous As an experiment,replace your RETURN with just 1 and see if the error goes away. Seems like everything being compared should be text.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.