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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
AutyDA
Helper I
Helper I

Calculate column data for a date based upon a slicer

I am new to PowerBI and slowly learning how to advance.

 

I have different financial data for various companies and periods. Based upon a series of slicers (company, dates, quarterly/annual data) this data is filtered. From this filtered data I want to identify the data at the chosen start and end dates. I've added some measures which determine the start and end dates selected by a slicer but don't know how to use this to find the data (revenue for example) on these dates.

 

For example, in the visual shown below the yellow box is reporting on the results of the slicers and I am trying to obtain the revenue on the starting data (2.5m based upon the slicers) and end date (3.5m based upon the slicers) and a comment on this.

 

Here is a link to the sample data I am using - Sampledata.pbix 

 

Any help appreciated.

 

AutyDA_2-1725951853125.png

 

AutyDA_1-1725950772382.png

 

 

AutyDA_0-1725950682573.png

 

 

 

1 ACCEPTED SOLUTION
zenisekd
Super User
Super User

Hi, create these two measures (not columns):

FirstDateRevenue =
CALCULATE (
SUM ( 'Table'[Revenue] ),
'Table'[Date] = MIN ( 'Table'[Date] )
)

LastDateRevenue =
CALCULATE (
SUM ( 'Table'[Revenue] ),
'Table'[Date] = MAX( 'Table'[Date] )
)

View solution in original post

2 REPLIES 2
AutyDA
Helper I
Helper I

Thank you, that worked perfectly!

zenisekd
Super User
Super User

Hi, create these two measures (not columns):

FirstDateRevenue =
CALCULATE (
SUM ( 'Table'[Revenue] ),
'Table'[Date] = MIN ( 'Table'[Date] )
)

LastDateRevenue =
CALCULATE (
SUM ( 'Table'[Revenue] ),
'Table'[Date] = MAX( 'Table'[Date] )
)

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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