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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! 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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.