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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Writing dax using filters

Hi All,

 

I need to write dax for below condition like externally funded & internally funded  I need to eliminate location code which shaded to calculate external and need to eliminate all except location code that gives internal. And need to calculate YOY% Ext & Int YOY%

 

I hav a sql query 

Ext. Funded A$ =

SUM(REGIS_PAYM_F.TOT_NET_USD_AM)

FROM

REGIS_PAYM_F

WHERE

PAYM_MTHD_TYPE_CD IS NULL

OR PAYM_MTHD_TYPE_CD <> ‘Location Code’

Int. Funded A$ =

SUM(REGIS_PAYM_F.TOT_NET_USD_AM)

FROM

REGIS_PAYM_F

WHERE

PAYM_MTHD_TYPE_CD = ‘Location Code’

snap 2.PNGInkedCapture_LI.jpg

 

Thanks

ng

1 ACCEPTED SOLUTION
Anonymous
Not applicable

something like this:

 

[Ext. Funded A$] =
CALCULATE (
    SUM ( REGIS_PAYM_F[TOT_NET_USD_AM] ),
    OR (
        REGIS_PAYM_F[PAYM_MTHD_TYPE_CD] = BLANK (),
        REGIS_PAYM_F[PAYM_MTHD_TYPE_CD] <> "Location Code"
    )
)
[Int. Funded A$] =
CALCULATE (
    SUM ( REGIS_PAYM_F[TOT_NET_USD_AM] ),
    REGIS_PAYM_F[PAYM_MTHD_TYPE_CD] = "Location Code"
    )
)

This is assuming that your TableName is still "REGIS_PAYM_F", and that your ColumnNames are [TOT_NET_USD_AM] and [PAYM_MTHD_TYPE_CD]

 

I strongly recommend renaming tables and columns with friendly names, it makes it MUCH easier to create DAX measures when the user fully understands what the columns mean.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

something like this:

 

[Ext. Funded A$] =
CALCULATE (
    SUM ( REGIS_PAYM_F[TOT_NET_USD_AM] ),
    OR (
        REGIS_PAYM_F[PAYM_MTHD_TYPE_CD] = BLANK (),
        REGIS_PAYM_F[PAYM_MTHD_TYPE_CD] <> "Location Code"
    )
)
[Int. Funded A$] =
CALCULATE (
    SUM ( REGIS_PAYM_F[TOT_NET_USD_AM] ),
    REGIS_PAYM_F[PAYM_MTHD_TYPE_CD] = "Location Code"
    )
)

This is assuming that your TableName is still "REGIS_PAYM_F", and that your ColumnNames are [TOT_NET_USD_AM] and [PAYM_MTHD_TYPE_CD]

 

I strongly recommend renaming tables and columns with friendly names, it makes it MUCH easier to create DAX measures when the user fully understands what the columns mean.

Anonymous
Not applicable

Dear Cris,

 

Thanks for your solution its works

 

 

thanks

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.