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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.