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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
geiratatea
Frequent Visitor

Creating two virtual tables from one target table and some measures

Hi!

 

I have a challenge that I really want to solve. It is like this.

 

Target table contains a set of targets with certain values. Each Target has an investment cost and a npv. Targets can be combined to get the highest sum of npv but it cannot exceed the budget limit here set to 4 000 000.

 

Based on this rule, a set of permutations must be checked. Here all targets on their own is lower than the limit. In combinations there could be a lot more. This combination table is the TargetPool.

 

Could this table be created by a virtual table construction using DAX? A valid combination of targets creates a portfolio ID => P{#}. The Portfolio table could of course also be extracted out of TargetPool making another virtual Table. Then you only have one actual Table and two virtual tables (loosing the relationship).

 

But if any of you is able to create this and also can reuse these two measures, I would be grateful

 

Total_PortfolioNPV = CALCULATE([TotalNPV],TargetPool)
 
RankMeasure =
CALCULATE (
    RANKX ( ALLSELECTED ( 'Portfolio'), CALCULATE([Total_PortfolioNPV],ALLEXCEPT(Portfolio,Portfolio[PortfolioID])),, DESC, DENSE )
)

 

geiratatea_1-1673915191411.png

 

 

geiratatea_0-1673915136784.png

 

 

 

1 REPLY 1
Anonymous
Not applicable

HI @geiratatea,

Did you mean to setting a condition on bottom level summarized values to prevent them above the 4M(this condition will be ignored when expressions work on the total levels), right?

If that is the case, you can refer to the Greg’s blog to use summarize function in a variable to summary value with their groups , then you can use iterator function sumx to apply the second level aggregated with if statement to check and replace these over target values.

Measure Totals, The Final Word 

Regards,

Xiaoxin Sheng

Helpful resources

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

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors