Forum Discussion

jagus's avatar
jagus
Regular Visitor
5 years ago

Simple.....?...DAX Question

Hello,

I am publishing a paginated report connecting to Power BI dataset. The dataset looks like this:

 

 

Transactions are recorded for March, Feb, and Jan 2021 and the requirements are next. 

 

 

  1. The first requirement is to get the current month's balance for all accounts that are not 55500 nor 888000.
  2. The second requirement is that for the account 55500 the balance is the current YTD. 
  3. The third requirement is to get the balance of the all other accounts times -1 to balance zero when all balances are added.

#1 and #2 are straightforward, 

 

EVALUATE
SUMMARIZECOLUMNS
         (

                    group6, group7, group8, group9,
                    dept, subdept, account,
                     "TotBal", CALCULATE(SUM('table'[tranval]),
                                 'table'[account]<>"55500" && 'table'[account]<>"88800"),
                    "Tot55500", CALCULATE(SUM('table'[tranval])),
                                 FILTER(VALUES('table'[tranval]),'table'[account]="55500"),
                                 FILTER(VALUES( 'table'[trandate]), YEAR('table'[trandate]) = YEAR(datevalue("3/1/2021")))                     
              )

 

 

#3 just cannot figure it out. How to get AdjBal?

 

As you can see, the balance for account 88800 should be the value to zero out the aggregation of all other balances (440-75+50) = 220 * (-1) = -415

 

Any ideas are greatly appreciated.

 

Thanks,

Antonio

 

 

 

2 Replies

  • v-xiaotang's avatar
    v-xiaotang
    Community Support

    Hi jagus 

    it's impossible to continue generating the column AdjBal in that function. so we can only recreate the column AdjBal  later.

    for example,

    OR
    could you share your sample data or sample file after removing sensitive information? so that we can work on it further.

    Any question, please let me know.

     

     

    Best Regards,

    Community Support Team _ Tang

    If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

  • v-xiaotang's avatar
    v-xiaotang
    Community Support

    Hi jagus 

    Have you solved your problem? If yes, kindly accept the answer helpful as the solution(OR kindly share your solution😁). so the others can find it more quickly.

    Or

    if problem still persists, please let me know.

     

     

    Best Regards,

    Community Support Team _ Tang