Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
nightfall
Helper I
Helper I

Time intelligence functions from the output of a measure

Hi all, i am trying to create the cash flow statement from a budget.

The model has only yearly values.

 

This is the relevant table 'Costi'

nightfall_0-1629391961110.png

 

I make up the monthly values by weighting the per-month amounts from the previous years. The weight are then stored in a calculated table 'Pesi':

nightfall_1-1629392098389.png

I finally create the measure to allocate the costs through the year:

CALCULATE(
SUMX( 'Costi', 'Costi'[Saldo finale] * - 1 * [Stagionalita] ),
TREATAS( SUMMARIZE( 'Calendar', 'Calendar'[Year] ), 'Costi'[Anno] )
)

 

where [Stagionalita] is the following:

VAR MeseCorrente =
IF( ISFILTERED( 'Calendar' ), VALUES( 'Calendar'[MonthNum] ), BLANK() )
RETURN
SUMX( FILTER( 'Pesi', 'Pesi'[Mese] = MeseCorrente ), 'Pesi'[Peso] )

 

-----------------

 

Now, with this measure i allocate the monthly cost, and it seems to work fine; however the next step would be to allocate to the relevant month the cash flow, e.g. the measure allocates 500€ to january for the account n.410010, but the cash flow would occur let's say the next month.

However, given that there is no table linked to the Calendar table, i am totally lost on how to do it.

 

Do you have by chance any hint on that?

 

Thank you and best regards,

 

Vittorio

 

 

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Your calendar table should be on day level, and it should be connected into your data model.

 

You are already familiar with TREATAS - you can continue to use it to transport filters between unconnected tables.

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

Your calendar table should be on day level, and it should be connected into your data model.

 

You are already familiar with TREATAS - you can continue to use it to transport filters between unconnected tables.

Hi @lbendlin,

thank you for your reply.

 

at the end indeed i thought it'd be much easier to go through a calculated column instead of trying to do everything through measures, as at the end of the day the values i was building should have been part of the "fact table", and thus a calculated column should be still ok.

I have therefore simply first added a calculated column to 'Pesi' that multiplies the yearly budgeted value with the weight, and finally a date column with EOMONTH((date(2022,Pesi[Mese],1)),0).

I should go always through the easy way 🙂
Thank you again and best regards,
 
Vittorio

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.