Forum Discussion

erenonem's avatar
erenonem
Frequent Visitor
3 years ago

Help with my dax

Hi all,

 

I m just trying to remove all my calculated columns with a measure contains a virtual table.

 

any chance to get any help?

 

//Normally I created a USD column in my Fact_XTable and SUMX it with another table in my measure.

All I want is to create a measure without a calculated column...

 

EVALUATE
VAR _vfxtable=


ADDCOLUMNS(Fact_Inspection,
// VALUES(Fact_XTable[XTable_sale_date]),
"CURR",
var __date=Fact_XTable[XTable_sale_date]
RETURN
MAXX(FILTER(Dim_Currency,Dim_Currency[Date]=__date
),
Dim_Currenct[Usd]
)
)

var _Isnotnull=FILTER(_vfxtable,Fact_XTable[XTable_sale_date]>DATE(2022,01,01))

RETURN
CALCULATE (
SUMX (
'Fact_XTable',
'Fact_XTable'[V1_Price] * CURR
),
ISBLANK ( 'Fact_XTable'[XTable_sale_date] ) = FALSE,
USERELATIONSHIP ( 'Fact_XTable'[XTable_sale_date], Dim_Calendar[Date] )
)

7 Replies

    • erenonem's avatar
      erenonem
      Frequent Visitor

      Hi,

       

      Really sorry for late reply.

       

      Error is 

      and you can see what I need below

       

      • BrianConnelly's avatar
        BrianConnelly
        Icon for Resolver III rankResolver III

        If there is an Active relationship, why don't you use the

        RELATED(<column>)  

        function?

  • erenonem's avatar
    erenonem
    Frequent Visitor

    My bad, "There is no active relationship". so that couldnt use "related" function.

     

    I am looking for a solution for fields that are both created as a calculated column in Power bi and fields from joins created for such purposes in SQL. If somehow I manage to use a "virtual" calculated column in a measure, then I may remove almost 100 calculated columns and many other SQL queries..

      • erenonem's avatar
        erenonem
        Frequent Visitor

        I do use Lookupfuntion in my calculated column but I do not want to create a calculated column, and I dont know jow to use any lookup function in a measure..