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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Date Hierarchy extending beyond last date in dataset

I have a data set of pipeline milestone activity from 1/1/18 to today (5/31/19), and I'm trying to show a YTD comparison of 2018 and 2019 pipeline volume by milestone (i.e YTD 5/312018 vs YTD 5/31/19). I'm using the following fields: [CreateDate] (transaction date the time intelligence is based on), [Milestone] and [NewVolume]. When I pull the [CreateDate] into the table, the values start at January 2018 (using only year and month) and continue through December 2019, eventhough the last date in my dataset is 5/31/19. Wondering how I can get it to stop at the end of my dataset and not extend through the end of 2019? The table below shows my data by month as well as the YTD and YTD Last Year columns. In the visual, it shows YTD December, which is not accurate. Thanks in advance for your help!

 

YTD Hierarch Issue.JPG

9 REPLIES 9
Ashish_Mathur
Super User
Super User

Hi,

Try this measure

=IF(ISBLANK(your_measure),BLANK(),your_measure)

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

I tried this, it didn't work because of the date heirarchy extending to December 2019. The YTD formulas think that YTD is December 2019.

hi, @Anonymous 

Just add a conditional in your formula:

Comm Vol YTD = 
IF (
    MIN ( 'History: Loan'[CreatedDate].[Date] )
        <= CALCULATE ( MAX ( 'History: Loan'[CreatedDate] ), ALL ( 'History: Loan' ) ),
    TOTALYTD('History: Loan'[Total New Comm],'History: Loan'[CreatedDate].[Date])
)
Comm Vol YTD Last Year = IF (
    MIN ( 'History: Loan'[CreatedDate].[Date] )
        <= CALCULATE ( MAX ( 'History: Loan'[CreatedDate] ), ALL ( 'History: Loan' ) ),
calculate([Comm Vol YTD],SAMEPERIODLASTYEAR('History: Loan'[CreatedDate].[Date])))

Result:

5.JPG

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@v-lili6-msftThe condition added to the formula worked on the visual that is by month (top visual in picture), however, when I go up a level and total by year (bottom visual in picture), the 'New Com Vol YTD Last Year' still shows YTD Dec and not YTD June. The by year visual is what I want to use in my report. I'm going to remove the solution flag and see if we can figure out the YTD values or what is causing the date heirarchy to extend past the end of the data set.

YTD Hierarch Issue by month & Year.JPG

Hi,

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@Ashish_Mathur Sorry I cannot share my PBI file as it contains sensitive data.

calerof
Impactful Individual
Impactful Individual

Hi @Anonymous ,

 

First make sure you have a date table.

 

Then you could try using the following YTD measures after your first Total New Comm aggregation:

 

Sales YTD = IF(
                MIN( 'Calendar'[Date] ) <= CALCULATE( MAX( 'History: Loan'[Date] ), ALL( 'History: Loan' ) ),
                        CALCULATE(
                                'History: Loan'[Total New Comm],
                                DATESYTD( 'Calendar'[Date] )
                        )
                    )
Sales YTD LY = VAR DataMaxDate = 
                                CALCULATE( MAX( 'History: Loan'[Date] ), ALL( 'History: Loan' ) )
                      RETURN
                                CALCULATE(
                                        'History: Loan'[Sales YTD],
                                        SAMEPERIODLASTYEAR(
                                            INTERSECT(
                                                VALUES( 'Calendar'[Date] ),
                                                DATESBETWEEN( 'Calendar'[Date], BLANK(), 
                                                DataMaxDate )
                                            )
                                        )
                                )

Hope it helps.

 

Cheers,

 

Fernando

 

calerof
Impactful Individual
Impactful Individual

Hi @Anonymous ,

 

In order to be able to help you, it'd be nice if you share your formulas.

 

Best regards,

 

Fernando

 

Anonymous
Not applicable

I believe the issue is with the date hierarchy, however here are my formulas:

 


Total New Comm = sum('History: Loan'[New Comm. Vol.])

New Comm Vol YTD =

TOTALYTD('History: Loan'[Total New Comm],'History: Loan'[CreatedDate].[Date]))

New Comm Vol YTD Last Year = calculate([New Comm. Vol. YTD],SAMEPERIODLASTYEAR('History: Loan'[CreatedDate].[Date]))

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.