cancel
Showing results for
Did you mean:
Frequent Visitor

## Dax Calculation to show current year and variance data in a single measure

Hi

We are preparing an indirect method of the cash flow statement from the general ledger data.  I will insert the table image of general ledger data and cash flow mapping.

General ledger data sample image

Cash flow mapping image

In cashflow mapping, we have mentioned the direct and indirect connections of financial nodes.

We need to show current year data to DIRECT cashflow bucket list items and also we need to show Variance (Current year- last year) for INDIRECT cashflow bucket lists item.  In the cash flow statement in a single column, we need to show current year and variance measure in a single column by using a dax measure.

Direct Connection

Dividend Income

Amortization of software

Depreciation

Indirect Connection

Increase (decrease) in provision for bonuses

Increase (decrease) in provision for bonuses for directors (and other officers)

Increase (decrease) in provision for retirement benefits for directors (and other officers)

Increase (decrease) in provision for retirement benefits

Increase (decrease) in provision for retirement benefits

Increase (decrease) in provision for retirement benefits for directors (and other officers)

Increase (decrease) in provision for loss on guarantees

Increase (decrease) in provision for point card certificates

Relationship image

In the cash flow statement in a single column, we need to show the current year and variance measure in a single column by using a dax measure.

Community members, please suggest a way to solve this issue.

1 ACCEPTED SOLUTION
Community Support

You can try this method:

Notice that your current and variance are both measures, so I create the data like this:

New measure:

Current = SUM('Table'[Current Year])
var = SUM('Table'[Variance])

The two measures above are simulated the measure you have.
The only measure you need to create by yourself is below:

Result = IF(MAX('Table'[Type]) = "Direct", [Current], [var])

The result is:

Is this what you expect? Hope this helps you.

Here is my PBIX file.

Best Regards,

Community Support Team _Yinliw

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

5 REPLIES 5
Frequent Visitor

Understood. Thanks for your reply.I will explain the issue shortly. Please go through the image. Financial accounts are in a single column and we mentioned the types of the accounts. For direct accounts, we want to show the current year data and for indirect accounts, we want to show the variance data. We need to show both data in a single column by using a single measure.

Community Support

You can try this method:

Notice that your current and variance are both measures, so I create the data like this:

New measure:

Current = SUM('Table'[Current Year])
var = SUM('Table'[Variance])

The two measures above are simulated the measure you have.
The only measure you need to create by yourself is below:

Result = IF(MAX('Table'[Type]) = "Direct", [Current], [var])

The result is:

Is this what you expect? Hope this helps you.

Here is my PBIX file.

Best Regards,

Community Support Team _Yinliw

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

Frequent Visitor

Hi @v-yinliw-msft

Thank you for your response. I have tried your dax its working perfectly.

Super User

OK, should this not be as easy as creating a measure that displays different numbers utilizing conditional logic via IF or SWITCH? The branching should be based on the type of the account...

Super User

A bit too much to read, I guess. Can you not break this down into smaller, more digestible chunks, please? As it currently stands, I have serious doubts someone will be willing to dissect this... but might be wrong 🙂

Also, if I were you, I'd place a link to a file with sample data that demonstrates the issue. Otherwise, it'll be hard to deal with this, I suppose.

Announcements

#### 2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

#### Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

#### Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

#### Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.

Top Solution Authors
Top Kudoed Authors