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

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

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
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.