cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JakeJack
Frequent Visitor

Incorrect Row Subtotal when using coalesce

Hi all

 

I'm trying to create a cash flow using the matrix visual.  

 

I have most things working except for subtotals - see below:

 

CF Subtotals.jpg

As you can see the subtotals For the Cash Flow from Operating Activities and Cash Flow from Financing Activities are incorrect.

 

The measures I'm using are:

 

CF Actuals = COALESCE([CF Value from PL],[CF BS Change])
 
CF Value from PL = IF([CF Select Category] in {209,3100,4000,705},[Total Value CY]*-1,[Total Value CY])
 
CF BS Change =
(IF([CF Select Category] in {209,3100,4000,705},[Balance Sum]*-1,[Balance Sum])-CALCULATE(IF([CF Select Category] in {209,3100,4000,705},[Balance Sum]*-1,[Balance Sum]),PARALLELPERIOD(Dates[CurDate],-1,MONTH)))
 
Total Value CY = sum('Sage PL'[val])*-1
 
Balance Sum = sum('Sage BS'[Val])
 
The reason I'm using the coalesce function is that the values are coming from 2 FACT table - 'Sage PL' and 'Sage BS'.
 
NB The subtotal are also not reflecting the change in sign either - the -195 should be 195.
 
Any help would be most appreciated .
 
Thanks
 
Jake 
 
 
 

 

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@JakeJack,

 

One approach is to use SUMX to iterate the dimension table that is used in matrix rows. Example measure:

 

CF Actuals with Correct Totals =
SUMX ( VALUES ( DimTable[Column] ), [CF Actuals] )




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
DataInsights
Super User
Super User

@JakeJack,

 

One approach is to use SUMX to iterate the dimension table that is used in matrix rows. Example measure:

 

CF Actuals with Correct Totals =
SUMX ( VALUES ( DimTable[Column] ), [CF Actuals] )




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Many thanks - that worked a treat.  

 

It had me stumped so much that I was considering adding a specific cash flow FACT table.

 

Cheers

 

Jake

@JakeJack,

 

Glad to hear that worked, and that you avoided creating an additional fact table. 🙂





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors