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
Gondi63
Helper I
Helper I

ParallellPeriod and Single Selection Filter

I'd like to create a matrix with a Value for [Net Revenue] and [Net Revenue Prior Year].

 

I've created both measures and they seem to be calculating correctly:

multiyear.PNG

 

However, if I change the slicer to single select or select only a single year, I lose the Prior Year data:

 

singleyear.PNG

 

What's the best method to show both values when only single year is selected?

 

 

6 REPLIES 6
Gondi63
Helper I
Helper I

I marked the calendar table as a date table. 

 

Trying each of these two options, I get the same behavior. Correct calculations when all years are selected, but when I select an individual fiscal year, I get blanks in each of the "prior year" calculations.

 

ghaines
Resolver I
Resolver I

This could happen if your slicer is acting on the year in the fact table, instead of on the calendar.

 

If not, could you post the formula for "Net Revenue"?

Net Revenue = 
    SUMX(
        'Line Items',
        'Line Items'[Net Revenue]
    )

 

Confirming, the slicers/filters are set on fields from the Fiscal_Calendar DIM table.

Try changing to SUM('Line Items'[Net Revenue])
I don't think the formula you have there is typical.  I haven't used a formula quite like that.  typically it would be something like:

SUMX(
        VALUES('Line Items'[Product Types]),
        'Line Items'[Net Revenue]
    )

but that is for certain applications, not as a basic calculation.

 

SUMX calculates the second term for each individual value of the first term.  I'm speaking outside of my experience because I've never used sumx where the first term is an entire table, but I expect that the filter on date is providing a context first, which limits the rows of 'Line Items' that are used in the calculation of the second term.  So "Sum over the currently selected rows of 'Line Items'" has already excluded PY if that makes sense.

Thanks for the follow up --

 

I don't see any behavior change when swiching to SUM()

Net Revenue PY = 
    CALCULATE(
        SUM(
            'Cornerstone Line Items'[Net Revenue]
        ),
        PARALLELPERIOD('Fiscal Calendar'[Fiscal_Year_Date],-1,YEAR
        )
    )

 

amitchandak
Super User
Super User

@Gondi63 , Make sue the fiscal calendar is marked as a date table.

 

Also try measure like

 

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[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.

Top Solution Authors