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

Power Query

Having Issue with this query,what will be the right Solution ? please SuggestHaving Issue with this query,what will be the right Solution ? please Suggest

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Yashodhan , This DAX is not power Query. In Power Query you need to merge data to get a column from another table

refer if needed

https://eriksvensen.wordpress.com/2019/02/28/powerquery-replicate-doing-an-excel-vlookup-in-m/

View solution in original post

v-eqin-msft
Community Support
Community Support

Hi @Yashodhan ,

 

M Language and DAX are supported by Power BI to manage, manipulate, filter, and analyze the data. but they are not the same and not dependent upon each other and each one has different syntax, structure, and logic.

 

Based on your screenshot, it seems that you want to set a flag column based on a related column from two tables.

If so, I have built a data sample as shown below:

Eyelyn9_3-1639102583241.png

 

 

Please try:

  • Use DAX: Add a Column
Column(DAX) = IF(ISBLANK(RELATED(TABLE2[Monthly BRAESN])) && ISBLANK( RELATED(TABLE2[Monthly ESN] )),"New","Old")

Eyelyn9_5-1639102704980.png

 

 

  • In Power Query: Merge two tables and Expand columns-->Add a custom column-->Remove unnecessary columns
=if [Monthly BRAESN] is null and [Monthly ESN] is null then "New" else "Old"

Eyelyn9_2-1639102495547.png

 

 

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

View solution in original post

2 REPLIES 2
v-eqin-msft
Community Support
Community Support

Hi @Yashodhan ,

 

M Language and DAX are supported by Power BI to manage, manipulate, filter, and analyze the data. but they are not the same and not dependent upon each other and each one has different syntax, structure, and logic.

 

Based on your screenshot, it seems that you want to set a flag column based on a related column from two tables.

If so, I have built a data sample as shown below:

Eyelyn9_3-1639102583241.png

 

 

Please try:

  • Use DAX: Add a Column
Column(DAX) = IF(ISBLANK(RELATED(TABLE2[Monthly BRAESN])) && ISBLANK( RELATED(TABLE2[Monthly ESN] )),"New","Old")

Eyelyn9_5-1639102704980.png

 

 

  • In Power Query: Merge two tables and Expand columns-->Add a custom column-->Remove unnecessary columns
=if [Monthly BRAESN] is null and [Monthly ESN] is null then "New" else "Old"

Eyelyn9_2-1639102495547.png

 

 

Best Regards,
Eyelyn Qin
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

@Yashodhan , This DAX is not power Query. In Power Query you need to merge data to get a column from another table

refer if needed

https://eriksvensen.wordpress.com/2019/02/28/powerquery-replicate-doing-an-excel-vlookup-in-m/

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
Top Kudoed Authors