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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
LLong
Frequent Visitor

Current Week and Year To Date Revenue Drill Through by Categories

I've a drilldown page displaying a table with the following columns - [Region], [Owner], [Week Revenue], [YTD Revenue]

I want the YTD Revenue column to display the total Revenue for the FiscalYear up to and including the FiscalWeek as determined by the Drill Through filters. Those filters are Region, FiscalWeek, FiscalYear.

This is my DAX for the YTD measure:

YTD = CALCULATE(sum('opportunity'[Actual Revenue (Base)])/1000,
FILTER(
ALL('opportunity'),
'opportunity'[FiscalWeek] <= Max('FiscalYearWeek'[FiscalWeek])),
'opportunity'[FiscalYear] = MAX('FiscalYearWeek'[FiscalYear]))

What I am getting though is the grand Total for that column returned against each row. It is not being split by Region and Owner. I've spent hours trying to work it out but no luck so far. It looks like row context, but nothing I've tried has helped. I also tried a Calculated Column with variables for the Region and Owner but that didn't work either.
I would be very grateful for any tips.

Mock-up in excel of my output as it's easier to redact.
LLong_0-1716984483933.png

 

Many thanks.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @LLong 

 

You have to keep the filter on Owner and Region. Try this measure

YTD =
CALCULATE (
    SUM ( 'opportunity'[Actual Revenue (Base)] ) / 1000,
    FILTER (
        ALLEXCEPT ( 'opportunity', 'opportunity'[Region], 'opportunity'[Owner] ),
        'opportunity'[FiscalWeek] <= MAX ( 'FiscalYearWeek'[FiscalWeek] )
    ),
    'opportunity'[FiscalYear] = MAX ( 'FiscalYearWeek'[FiscalYear] )
)

 or

YTD =
CALCULATE (
    SUM ( 'opportunity'[Actual Revenue (Base)] ) / 1000,
    ALLEXCEPT ( 'opportunity', 'opportunity'[Region], 'opportunity'[Owner] ),
    'opportunity'[FiscalWeek] <= MAX ( 'FiscalYearWeek'[FiscalWeek] ),
    'opportunity'[FiscalYear] = MAX ( 'FiscalYearWeek'[FiscalYear] )
)

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @LLong 

 

You have to keep the filter on Owner and Region. Try this measure

YTD =
CALCULATE (
    SUM ( 'opportunity'[Actual Revenue (Base)] ) / 1000,
    FILTER (
        ALLEXCEPT ( 'opportunity', 'opportunity'[Region], 'opportunity'[Owner] ),
        'opportunity'[FiscalWeek] <= MAX ( 'FiscalYearWeek'[FiscalWeek] )
    ),
    'opportunity'[FiscalYear] = MAX ( 'FiscalYearWeek'[FiscalYear] )
)

 or

YTD =
CALCULATE (
    SUM ( 'opportunity'[Actual Revenue (Base)] ) / 1000,
    ALLEXCEPT ( 'opportunity', 'opportunity'[Region], 'opportunity'[Owner] ),
    'opportunity'[FiscalWeek] <= MAX ( 'FiscalYearWeek'[FiscalWeek] ),
    'opportunity'[FiscalYear] = MAX ( 'FiscalYearWeek'[FiscalYear] )
)

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

Fantastic, ALLEXCEPT is what I was missing. Thank you!

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 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.