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

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
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
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.