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
gustavoleo
Helper II
Helper II

Last Total Balance of the last Business Day based on the selection of the Date

Hi Power BI Lover's

Here I'm to share my simple DAX issue.

I would love to hear you

I need to build a report that shows the total balance, orders and back log orders

And I would love a measure that brings me the total of the balance of the last business day based on the selection of the date slicer

For my susrprise non of those measures works

 

LAST BALANCE SELECTED DATE ALLSELECTED(PREVIOUSDAY
= CALCULATE([TOTAL BALANCE];PREVIOUSDAY(ALLSELECTED(CALENDAR[Date].[Date])))

 

LAST BALANCE SELECTED DATE PREVIOUSDAY =
CALCULATE([TOTAL BALANCE];PREVIOUSDAY(CALENDAR[Date].[Date]))

 

LAST BALANCE SELECTED DATEADD = 
CALCULATE([TOTAL BALANCE];DATEADD(CALENDAR[Date].[Date];-1;DAY))

 

 

 

 DATAMODEL.PNG

calendar.PNG

 

1 REPLY 1
v-sihou-msft
Employee
Employee

@gustavoleo

 

When using time intelligence functions like PREVIOUSDAY(), DATEADD(), etc, you must give a date column with full calendar date values. These dates should be contigous and unique.

 

So in this scenario, you need to create a calendar table and build relationship to your fact table on Date column. Then put the Calendar[Date] into time intelligence functions to make your DAX work.

 

Rergards,

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.