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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Vvelarde
Community Champion
Community Champion

Create a Measure with calculate of a specified period with no affect by slicers

I have this data:

 

Table Sales

 

Year        Month        Sales  Product

2015     December     7500   Shoes

2015     December     8000   Pants

2016     January       10000   Shoes

2016     January       15000   Pants

2016     February      80000  Shoes

2016     February      80000  Pants

2016     March          7500   Pants

2016    March          5000    Shoes

 

Table Month

 

Month

January

February

December

 

Table   Losses

 

Year        Month        Losses  Product

2015     December     4500     Pants

2015     December     3500     Shoes

2015     January        2500     Shoes

2015     January        1500     Shoes

 

I need to create a measure that show me the selected month (In a slicer) with the Sum of sales in December 2015 and also another to show me the losses in this month selected.

 

My table desired is this

 

Product --Sales (Month Selected In Slicer) -- Sales(Always December 2015) --- Losses (Month Selected in Slicer)

Pants            Xxxxxx                                          8,000                                                     XXXXXXXXX

Shoes            xxxxxxx                                       7,500                                                       XXXXXXXX

 

 

When i slice by Month in Sales and select a Month by example March; Field Sales show corrects but Losses no.

 

When i slice by Table Month and select a Month by example March; Field Losses show corrects but Sales December is Blank.

 

My Dax Formula for measure in Sales December is

 

SalesDEC2015 = CALCULATE(Sum([Sales]);CALCULATETABLE( Sales[Month]="December";Sales[Year]=2015))

 

Thanks for your any help.

 

 

 

 

 

 




Lima - Peru
1 ACCEPTED SOLUTION
Sean
Community Champion
Community Champion

@Vvelarde You need to either combine Sales and Losses Columns in 1 Table

OR

you need a Product Table to make this work.

 

Then you can only drag Sales and Losses to a table and you'll get what you want - you don't need anything else except SUM

Calculate - 3 Tables.png

View solution in original post

1 REPLY 1
Sean
Community Champion
Community Champion

@Vvelarde You need to either combine Sales and Losses Columns in 1 Table

OR

you need a Product Table to make this work.

 

Then you can only drag Sales and Losses to a table and you'll get what you want - you don't need anything else except SUM

Calculate - 3 Tables.png

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.