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
user_007
New Member

Date filter

Hi all,

 

I'm trying to build a formulea that gives me the values for the same period in 2019.

 

My report has a date dropdown which the user would use to select a month (e.g. November 2022), and based on this the table will show the relevant data for that period. One of the column in the table i want the values for November 2019 however I can't seem to get this to work. 

 

I have built the below though it shows the total value for 2019, not November 2019:

 

Actual 2019 = CALCULATE(sum('Fusion Data'[Value]), FILTER(ALL('Calendar'),'Calendar'[Year]=2019))
 
Please can someone point out what I need to change for this to work?
 
Thank you
 
4 REPLIES 4
v-jialluo-msft
Community Support
Community Support

Hi  @user_007 ,

 

Based on your description, you need to calculate the sum based on the month selected by the slicer.

You can try:

 

Actual 2019 = CALCULATE(sum('Fusion Data'[Value]), FILTER(ALL('Calendar'),'Calendar'[Year]=2019 && 'Calendar'[Month] IN VALUES(Slicer fields)))

 

Because the ALL function is clear about the filter, you need to filter again based on the slicer field.
If this doesn't solve your question, provide slicer information or sample files

 

Best Regards,
Gallen Luo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

@v-jialluo-msft 

 

The suggestion didnt work, sure i did something wrong. I've shown a couple a screenshots in my response to @FreemanZ . Hopefully it provides the info you need.

 

Thanks

FreemanZ
Super User
Super User

What column do you put to the slicer? The exact the column name and sample value. A small screenshot will be great. 

Hi @FreemanZ 

 

The slicer is on the date filter, see below screenshot of the table I'm trying to build and also my calendar data

 

user_007_0-1670405243525.png

 

user_007_1-1670405271212.png

 

 

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.