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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply

context change

aggregation at customer name level
 

desired output 

Month Total 2023 Total 2024 LFL 2023 LFL 2024

Jan20352027
Feb21312122
Mar20372028
Apr32331233

Goal:

  1. Total 2023: Sum the sales for 2023 for each month.
  2. Total 2024: Sum the sales for 2024 for each month.
  3. LFL 2023: For each month, calculate the total 2023 sales only for stores that have sales in both 2023 and 2024 for that same month.
  4. LFL 2024: For each month, calculate the total 2024 sales only for stores that have sales in both 2023 and 2024 for that same month.


data

Month Store 2023 Sales 2024 Sales

JanS231012
JanS241015
JanS25(blank)8
FebS231211
FebS24911
FebS25(blank)9
MarS23(blank)9
MarS241518
MarS25510
AprS2320(blank)
AprS24221
AprS251012
3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1735696998300.png

 


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

@Hemant_Jaiswar , 

Create the following measures to calculate the totals and LFL (Like-for-Like) sales.

Total 2023 Sales = SUM('Sales'[2023 Sales])

 

Total 2024 Sales = SUM('Sales'[2024 Sales])

 

 


LFL 2023 Sales =
CALCULATE(
SUM('Sales'[2023 Sales]),
FILTER(
'Sales',
NOT(ISBLANK('Sales'[2023 Sales])) && NOT(ISBLANK('Sales'[2024 Sales]))
)
)


LFL 2024 Sales =
CALCULATE(
SUM('Sales'[2024 Sales]),
FILTER(
'Sales',
NOT(ISBLANK('Sales'[2023 Sales])) && NOT(ISBLANK('Sales'[2024 Sales]))
)
)

 

Go to the "Visualizations" pane and select the "Table" visualization.
Drag the "Month" column to the table.
Drag the measures you created (Total 2023 Sales, Total 2024 Sales, LFL 2023 Sales, LFL 2024 Sales) to the table.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






  1. this has to be done at store level without keeping store at that views and check each store via months only when sales is present in both the month that store should be calculated in total sales for that month
    LFL 2023
    : For each month, calculate the total 2023 sales only for stores that have sales in both 2023 and 2024 for that same month.
  2. LFL 2024: For each month, calculate the total 2024 sales only for stores that have sales in both 2023 and 2024 for that same month. please note

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors