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
Anonymous
Not applicable

YTD,MTD and QTD related month and year display

Hi,

I have given user selection for YTD,QTD and MTD.So when user selects any of these i need to display the related from Month year to To month Year.

Example : If user selects YTD and i have data from Jan'19 to Sep'19.So in a text object i need to display as (Jan'19 to Sep'19) If selected year is 2018 Then i need to display (Jan'18 to Dec'18). Same with QTD and MTD selections. Could anyone pls help me on this.

 

Thanks & Regards, Abhilash

1 ACCEPTED SOLUTION

So I believe that you want to say that the value/measure that you are calculating, for the last 3 months is 0.

So you can create measure as below:

Dynamic Range = 
VAR SelectedYear = YEAR(SELECTEDVALUE(Date[Year]))
VAR CurrentYearMonth = CALCULATE(FORMAT(LASTDATE(Date[Date]),"MMM"),FILTER(Table,[Measure]=0))
RETURN 
    IF(YEAR(TODAY())=SelectedYear,"Jan "&SelectedYear&" - "&CurrentYearMonth&" "&SelectedYear,"Jan "&SelectedYear&" - "&"Dec "&SelectedYear)

 

Please let me know if it didn't. 

View solution in original post

10 REPLIES 10

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.