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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Power Query - Matching value

Hi Team,

Power Query syntax :

I need following result for ID 5 only, please help  me.

 

Capture.PNG

Thanks,

KV's

4 REPLIES 4
V-pazhen-msft
Community Support
Community Support

@Anonymous 
I would recommend you create this column using dax instead power query, which is much simpler.

Weight = IF('Table'[ID]=5, CALCULATE(SUM([Value]),ALLEXCEPT('Table','Table'[Markets]),'Table'[ID]=39))
V-pazhen-msft_0-1619069940250.png

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.
Ashish_Mathur
Super User
Super User

Hi,

Why should the answer be 4?  Why not 0.65 or 0.35?  Bother to explain in detail.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @Ashish_Mathur ,

 

ID 5 pick ID 39 value for Weight and it must be match Markets.

thanks,

kV's

Hi,

Try this calculated column formula

Weight = calculate(max(data[value]),filter(data,data[markets]=earlier(data[markets])&&data[id]=39))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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