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
lachb82
Frequent Visitor

actual or budget profit and loss

Hi all

 

I am trying to create a monthly profit and loss report that displays both actual and budget relative to the date selected.

 

I can use the matrix visual and add measures for actual P&l and budget. That's ok, however I would like to show only the actual relative to the month selected, and the remainder being budget.

 

I have tried a logical agrgument, but just can't seme to get this right. Either it starts summing all of the actual months together, creates and error.

 

the ideal scenario would like something like...

 

Actual    Actual    Budget    Budget   Budget..... etc for a financial year

Jul-19    Aug-19   Sep-19    Oct-19    Nov-19

 

Below is the DAX I have tried using but I can't seem to filter the first few months to only show the actual relative to the month selected in a slicer.

 

Actual or Budget = IF(
LASTDATE(Dates[Date]) <= ENDOFMONTH( Dates[Date] ),
[P&L],
BLANK())
 
Many thanks in advance...
2 REPLIES 2
kentyler
Solution Sage
Solution Sage

Actual or Budget = IF(
SELECTEDVALUE('SlicerTable[Date]', 0)  = 'Dates'[Date]
'tablename'[Actual],
'tablename'[P&L])
 
I'm faking the table names here.
Selectedvalue will return the value selected in a slicer (or multiple values selected)
So this is trying to say if the selected month is equal to the month in the row, then return the actual, otherwise return the P&L
 




Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


thank you for the suggestion... though it's not giving the desired output

 

I get an error on the = 'Dates'[Date]
 
I have a Dates Table that defines financial years, months etc.
 
How do I get reference to the dates table...
 
Anyway the Matrix is still not filtering the values relative to the slicer selection
 
I have tried the below... but I can see I am refencing the same (moving) date based on the selected value...
 
Actual or Budget = IF(
SELECTEDVALUE(Dates[Date], 0 ) <= ENDOFMONTH(Dates[Date]),
CALCULATE( SUM('Invoices'[Line Amount Calculation]),
FILTER( 'Accounts', Accounts[Class] = "Revenue" || Accounts[Class] = "Expense" ))
 
- [P&L - Credit Notes] + [P&L (Journals)],
Blank())

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.

Top Solution Authors