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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
dwhittaker1
Helper I
Helper I

prevent column from being sliced by date

I wrote the measure below in hopes that this measure would be uneffected by the date column on the filter pane. It is in not working, does any one have any suggestions?
 
Gross Sales 2022 = CALCULATE(SUM(FactSalesInvoiceLine[InvoiceLineAmount]),FILTER(DimDate,DimDate[Year]= 2022),ALL(DimDate[Date]))
 
dwhittaker1_0-1712711122974.png

 

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi  @dwhittaker1 
Modify the measure for :
Gross Sales 2022 = CALCULATE(SUM(FactSalesInvoiceLine[InvoiceLineAmount]),ALL(DimDate), 'DimaDate[year]=2022)
it should work.
That is how it looks at my example (with other data) :

 

pbix is attached

 

 

Ritaf1983_1-1712715546875.png

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Does this work?

Gross Sales 2022 = CALCULATE(SUM(FactSalesInvoiceLine[InvoiceLineAmount]),'DimaDate[year]=2022)


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ritaf1983
Super User
Super User

Hi  @dwhittaker1 
Modify the measure for :
Gross Sales 2022 = CALCULATE(SUM(FactSalesInvoiceLine[InvoiceLineAmount]),ALL(DimDate), 'DimaDate[year]=2022)
it should work.
That is how it looks at my example (with other data) :

 

pbix is attached

 

 

Ritaf1983_1-1712715546875.png

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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