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

See when key Fabric features will launch and what’s already live, all in one place and always up to date. Explore the new Fabric roadmap

Reply
Anonymous
Not applicable

Current Quarter showing in all quarters (in visual)

Hello - I have a stacked column chart with the measure below applied. What is happening is that the current quarter ytd amount is showing up in all quarters...2,3,and 4. I just want the current quarter value to show up. So for Q1 it should show the Q1 value, then in Q2 show the Q2 value.
What do I need to change?
 
QTD Revenue = CALCULATE (
    'Flu Shipped'[Total Shipped Value]-[MTS Gebroeders Deferral],FILTER('Master Customer List','Master Customer List'[Customer ID]<>"C-04646"),FILTER('Master Customer List','Master Customer List'[Customer ID]<>"C-05165"),FILTER('Master Customer List','Master Customer List'[Customer ID]<>"C-04821"),
    CALCULATETABLE(
    DATESQTD ( 'DateTable'[Date] ),
    DateTable[DatesWithShipments] = TRUE
)
)

Quarter.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hello  -  Solved it myself using this formula which seems to work perfectly at the quarter and month level.  

 

If I put YTD on the visual, only the Q1 column shows the value...the other quarters show no value which is correct since we are in Q1.     If I drill down to months, only Jan and Feb show their respective mtd values  (since we are not in March yet).   

 

YTD 2 =
Var lastshipdate = CALCULATE(LASTDATE('Flu Shipped'[Date Shipped]),ALL('Flu Shipped'))
RETURN
IF(SELECTEDVALUE(DateTable[Date]) > lastshipdate, BLANK(),
CALCULATE (
    [YTD Revenue],
    FILTER(ALLSELECTED(DateTable),DateTable[Date] <= MAX('Flu Shipped'[Date Shipped]))
))
 
 

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

Try

QTD Revenue = CALCULATE (
    'Flu Shipped'[Total Shipped Value]-[MTS Gebroeders Deferral],FILTER('Master Customer List','Master Customer List'[Customer ID]<>"C-04646" 
	&& 'Master Customer List'[Customer ID]<>"C-05165" && 'Master Customer List'[Customer ID]<>"C-04821"),
    ,DateTable[DatesWithShipments] = TRUE
    DATESQTD ( 'DateTable'[Date] )
    
)

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hello  -  Solved it myself using this formula which seems to work perfectly at the quarter and month level.  

 

If I put YTD on the visual, only the Q1 column shows the value...the other quarters show no value which is correct since we are in Q1.     If I drill down to months, only Jan and Feb show their respective mtd values  (since we are not in March yet).   

 

YTD 2 =
Var lastshipdate = CALCULATE(LASTDATE('Flu Shipped'[Date Shipped]),ALL('Flu Shipped'))
RETURN
IF(SELECTEDVALUE(DateTable[Date]) > lastshipdate, BLANK(),
CALCULATE (
    [YTD Revenue],
    FILTER(ALLSELECTED(DateTable),DateTable[Date] <= MAX('Flu Shipped'[Date Shipped]))
))
 
 
Anonymous
Not applicable

I adjusted the formula a little as the syntax was showing an error.  

 

But the QTD value (for Q1) is still showing up for all of the quarters in my visual.   It should only, at this point in the year, be showing Q1.   

 

QTD Revenue2 = CALCULATE ( 'Flu Shipped'[Total Shipped Value]-[MTS Gebroeders Deferral],FILTER('Master Customer List','Master Customer List'[Customer ID]<>"C-04646" && 'Master Customer List'[Customer ID]<>"C-05165" && 'Master Customer List'[Customer ID]<>"C-04821"),DateTable[DatesWithShipments]= TRUE,DATESQTD(DateTable[Date]))
Anonymous
Not applicable

Hi Amit  -  I get an error (red line) on this part: 

 

DatesQTD ( 'DateTable'[Date] ) )

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

Check out the May 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

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