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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
KIL2022
Regular Visitor

Power Query - Need HLP

Hello,


i m looking for solution for Power Query:

1. Lookup Value - Same Table or Different Table

I have a formaula, but i get information back,  - Circle reference
Idea behind this is DAX = LOOKUPVALUE('Sales Account'[ID2],'Sales Account'[accountid],'Sales Account'[id])
____

(let

searchValue = [id]

in

Table.SelectRows(

    #"Sales Account",

    [accountid]=searchValue)

){0}[ID2]

2. Countif (without merging Tables)?

var sItem= Table1[Item]

var sVisit= Table1[Visit]

CALCULATE(COUNT(Table1[Item]),FILTER(Table1,Table1[Item.]=sItem),FILTER(Table1,Table1[Visit]=sVisit))

3. IF MAXX?

var sItem= Table1[Item]

var sVisit= Table1[Visit]
var sCreated = Table1[Created at]

IF(MAXX(FILTER(Table1,Table1[Visit]=sVisit&& Table1[Item]=sItem),Table1[Created at)=sCreated ,1,0)





1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @KIL2022 ,

 

1.The lookupvalue operation can use the merge function for match filtering. Please refer to

Merge queries overview - Power Query | Microsoft Learn

Solved: How to LOOKUPVALUE in PowerQuery? - Microsoft Fabric Community

 

2.The countif operation can achieved by group by and custom column. Please refer to

Power Query: COUNTIFS - Microsoft Community Hub

Solved: A simple way for COUNTIF function in power query - Power Platform Community (microsoft.com)

 

3.To filter the max value group by [visit] and [item], you can use group by feature and custom column.

vstephenmsft_0-1697007716386.png

Group by two fields:

vstephenmsft_1-1697007748499.pngvstephenmsft_2-1697007772558.png

Expand:

vstephenmsft_3-1697007783489.png

vstephenmsft_4-1697007789328.png

Create the custom column:

vstephenmsft_5-1697007834709.png

vstephenmsft_6-1697007867267.png

 

 

Best Regards,

Stephen Tao

 

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

1 REPLY 1
Anonymous
Not applicable

Hi @KIL2022 ,

 

1.The lookupvalue operation can use the merge function for match filtering. Please refer to

Merge queries overview - Power Query | Microsoft Learn

Solved: How to LOOKUPVALUE in PowerQuery? - Microsoft Fabric Community

 

2.The countif operation can achieved by group by and custom column. Please refer to

Power Query: COUNTIFS - Microsoft Community Hub

Solved: A simple way for COUNTIF function in power query - Power Platform Community (microsoft.com)

 

3.To filter the max value group by [visit] and [item], you can use group by feature and custom column.

vstephenmsft_0-1697007716386.png

Group by two fields:

vstephenmsft_1-1697007748499.pngvstephenmsft_2-1697007772558.png

Expand:

vstephenmsft_3-1697007783489.png

vstephenmsft_4-1697007789328.png

Create the custom column:

vstephenmsft_5-1697007834709.png

vstephenmsft_6-1697007867267.png

 

 

Best Regards,

Stephen Tao

 

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

 

Helpful resources

Announcements
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.