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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
santoshyadav
New Member

Power bi dax

  • I have two tables portfolio_dim and liquidity_fact which are joined with Id in model. Liquid table contains column like PortID, liquid_method, fraction, liquid_type. There are two types of liquid_method Sec and Int. One ID may have both the type of rows.

ID method fraction type

1, sec, 0.85, illiquid

1, Int, 0.75, illiquid 

2, Int, 0.65, illiquid 

 

If the ID with Sec method is also have ID with Int method the will show value of Sec and if not then value of Int.

I have to show the visual in desktop containing columns.

 

ID(dim table), type, fraction(sum)

1, illiquid, 0.85

2, illiquid, 0.65

2 REPLIES 2
Wilson_
Super User
Super User

Hi santoshyadav,

 

Try something like this as a measure:

 

Fraction (sum) =
VAR SecValue =
MAXX (
    FILTER (
        liquidity_fact,
        liquidity_fact[method] = "sec"
    ),
    liquidity_fact[fraction]
)
VAR Result = COALESCE ( SecValue, MIN ( liquidity_fact ) )

RETURN Result

 

 

I am assuming one ID has at most one sec row and one int row.


----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)

 

P.S. Need a more in-depth consultation for your Power BI data modeling or DAX issues? Feel free to hire me on Upwork or DM me directly on here! I would love to clear up your Power BI headaches.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





quantumudit
Super User
Super User

Hi @santoshyadav 

You can create a DAX measure like this and use it in your report table visual to get the desired result:

Fraction Value = 
VAR _secFraction =
    CALCULATE ( SUM ( Liquid_tbl[fraction] ), Liquid_tbl[method] = "sec" )
VAR _intFraction =
    CALCULATE ( SUM ( Liquid_tbl[fraction] ), Liquid_tbl[method] = "Int" )
RETURN
    IF ( ISBLANK ( _secFraction ), _intFraction, _secFraction )

 

You can also create a small measure "Total Fraction" as follows, and use it instead of SUM ( Liquid_tbl[fraction] )

Total Fraction = SUM ( Liquid_tbl[fraction] )

 

Here is the screenshot of the solution:

quantumudit_0-1713117529347.png

 

Best Regards,
Udit

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudo 👍

🚀 Let's Connect: LinkedIn || YouTube || Medium || GitHub
Visit My Linktree: LinkTree

 

 

 

 

 

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors