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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Sdg8481
Helper I
Helper I

A Table showing the total for a chosen weeknumber but also YTD and Previous YTD

Hi, Sorry this might be a very simple question but i just can't figure out a solution, Please bare with me as i'm fairly new to Power BI.

 

Basically, i have a table that contains a date, measure and value. I have also built a date table with is joined by Date and contains Week Number.

 

What i am trying to do is to create a single table that for each measure will show;

-  total for a chosen week number (as selected by the user)

  - total for the same week number last year

  - a total value for the current year upto and including the week number selected

  - a total value for the prior year upto and including the week number selected

 

*by year i mean financial year which runs from July-June.

 

I just can't figure it out, because i can get the TotalYTD formulas working, but obviosuly then when the user chooses a week number it limits the results to just that week.

 

any help or advise would be greatly appreciated.

 

Thanks

Stu

1 ACCEPTED SOLUTION

@Sdg8481,

 

Try using ALLSELECTED Function instead.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-chuncz-msft
Community Support
Community Support

@Sdg8481,

 

You may take a look at the following links.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you very much for these links, however i'm struggling to apply these to my issue. However, i have applied the

following, which seems to work.

 

Measure = CALCULATE(Sum('0 - Measureables'[Value]),(FILTER(ALL('0 - Measureables'),'0 - Measureables'[Date]<=(MAX('0 - Measureables'[Date])))))

 

HOWEVER, this completely ignores the 'Product Name' slicer (i assume because its referencng ALL). How can i adapt this so that the product name slicer is still filtered. Therefore giving a total for All previous dates for the chosen product name too.

 

I'm just stuck

 

@Sdg8481,

 

Try using ALLSELECTED Function instead.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you very much for these links, however i'm struggling to apply these to my issue. However, i have applied the

following, which seems to work.

 

Measure = CALCULATE(Sum('0 - Measureables'[Value]),(FILTER(ALL('0 - Measureables'),'0 - Measureables'[Date]<=(MAX('0 - Measureables'[Date])))))

 

HOWEVER, this completely ignores the 'Product Name' slicer (i assume because its referencng ALL). How can i adapt this so that the product name slicer is still filtered. Therefore giving a total for All previous dates for the chosen product name too.

 

I'm just stuck

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.