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
Anonymous
Not applicable

Composite Model and Direct query, loop up values from 2 tables

Question regarding Composite models

I have a Direct Query Table containg tons of data - DqTable(codes, date, name, status)

I have an imported table containing all the rules - RulesTable(name,status, newstatus)


I want to count number of codes which satisfy all the rules


Ex.
DqTable:
codes date name status
45852 1/2/19 ABC Completed
78513 1/3/19 DCV WIP-1
65753 1/3/19 ABC Not Completed


RulesTable:
name status newstatus
ABC Completed C1
ABC WIP C2
ABC Not Completed C3
DCV WIP-1 C2


[name] is common and I can make a relationship.

I tried to make a calculated table and failed.
I tried lookup function it works good as a measure but I used SELECTEDVALUE TO Select each code - but i am not able to save the results.


So i want to do it in calculated table, i want the below result
date name C1 C2 C3
1/2/19 ABC 1 - -


I tried this code:

CalcTable: ADDCOLOUMNS(SUMMURIZE(DqTable, DqTable[date], DqTable[names]), "C1", Calculate(COUNT(DqTable[codes]), LOOKUPVALUE(RulesTable[newstatus],RulesTable[status],DqTable[status], RulesTable[name],DqTable[name]) = "C1")

But i got LOOKUPVALUE function cannot be used as a Table Filter, I tried passing LOOKUPVALUE as a var, but it is not detecting DqTable[status]


Its complex please try to help me and let me know if you want any details

0 REPLIES 0

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.