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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
v-jingzhan-msft
Community Support
Community Support

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
v-jingzhan-msft
Community Support
Community Support

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
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors