Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Code an expression on Power Bi Report Builder

I have a model on Power Bi desktop where I calculate closed accounts with DAX in the following way :

Closed Accounts:=CALCULATE(CALCULATE(COUNTA('Accounts and Balances'[Close Date]),
USERELATIONSHIP('Accounts and Balances'[Close Date],'Calendar'[Date])),FILTER('Calendar',[Date]<TODAY()))

I have imported exactly the same datasets in Power Bi Report Builder and I am trying to calculate Closed Accounts by using an expression.  Do you please know how I can do that?

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    I have a Power Bi Desktop model with the following measure formula in DAX :

     

    Closed Accounts:=CALCULATE(CALCULATE(COUNTA('Accounts and Balances'[Close Date]),
    USERELATIONSHIP('Accounts and Balances'[Close Date],'Calendar'[Date])),FILTER('Calendar',[Date]<TODAY())).

     

    How can I write the same formula as an expression in Power Bi Report Builder?

     

    I have brought exaclty the same dataset in Power-Bi Report Builder.

  • v-danhe-msft's avatar
    v-danhe-msft
    Microsoft Employee

    Hi Anonymous ,

    Could you please offer your sample data to have a test? And what is your desired result? Where would you like to show the data, in a table or a card? 

     

    Regards,

    Daniel He