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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
TiagoANunes10
New Member

Like For Like Analysis

As requirements for the analysis, I have the following:

  1. Perform a Like For Like analysis for the stores in the dataset;
  2. Consider only the two most recent years (dynamically);
  3. Interact with the data only with a month name slicer;
  4. Take into account the store's closing date: a. Values should not appear in dates of homologous periods later than the store's closing date (for example, if the store closed in 202405, when selecting the month of November, values for 202311 should not appear even if there were sales). b. But the accumulated values (YTD) should appear at most up to the closing date and the respective homologous period.

The model represents a small sample of the original dataset, which contains about 30 million rows. To simplify, I included only a DIM_Calendar table and a FAT_Sales table. The calendar table is self-explanatory and relates to the sales table by the "YYYYMM" and "TRANSACTION_DATE" columns, respectively, resulting in a many-to-many relationship. On the sales side, I currently do not have daily granularity, only monthly.

The FAT_Sales table contains sales from 2 consolidated stores, Store A and Store B. Store A has only 1 store (A1), and Store B has 2 stores (B1 and B2). This table also contains the quantities sold over time (since 2022), as well as the date from which Like For Like started, and the closing date if the store has closed (this field is null if the store is still active).

 

My approach started by creating a calculated column to evaluate in each row of FAT_Sales whether it was "LFL" or "Not LFL". After that, using DAX measures, I performed the calculations included in the blank measures of this report when it was "LFL". I am not getting the logic right and I am a bit desperate with this report. Any help is welcome!

 

Link to the report:

https://drive.google.com/file/d/1KsGhmOEsD3lF5HhjNXH29UUpxW-dMU9h/view?usp=sharing 

5 REPLIES 5
TiagoANunes10
New Member

Link updated to a dropbox folder. Hope there's no perms issue now!

 

https://www.dropbox.com/scl/fi/r8qkhdqtdzjj9cmhdhhyn/LFL_Analysis.pbix?rlkey=lifb0r3z0jy8h9ielk2pxqu...

TiagoANunes10
New Member

I did. I am having a very hard time trying to apply the pattern to my model.

So I was looking for something out-of-the-box from the community.

I granted permission to the file, however I will check that.

danextian
Super User
Super User

Needs permission

danextian_0-1735015499390.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Granted!

 

gmsamborn
Super User
Super User

Hi @TiagoANunes10 

 

Have you read this?  https://www.daxpatterns.com/like-for-like-comparison/

 

Also, your link has problems with permissions.

 



Proud to be a Super User!

daxformatter.com makes life EASIER!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

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.