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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
powerbignc
Helper I
Helper I

Need Modeling and Dax Help for simple DAX IF

**I am not able to modify these table, so no calc columns or Power Query***

**Transaction Fact table is over 300 Million Rows and lives in SQL**

**Screenshots of tables are below text**

 

I have 4 tables

  • Dates Table
  • Transaction Table
  • Store Status Table
  • Store Metadata Table.

 

Dates Table = Simple dates table, Date, month, year etc...

Transaction table (300+ Million Rows) = Shows by date by store, the different transaction amounts

Store Status Table = Shows by data over time what was the store status on that day

Store table = List of stores, location of store etc...

 

I am trying to model these tables together so that I can write a formula that shows the transaction amount by day for a store ONLY when that store status on that day was "Open". 

 

So if there was a transaction on 2/21/22 for store A, but the status was "Closed" that day... don't count it.

 

 

Dates TableTransaction TableStore StatusStore
powerbignc_0-1673582644954.png
powerbignc_3-1673582998368.png

 

powerbignc_2-1673582765311.png powerbignc_4-1673583016067.png

 

 

 

Question 1: How does this need to be modeled to give me the answer I need?

Question 2: What is the formula I can write to do this?

 

Here is what I have, but I know this isn't right....

powerbignc_5-1673583143646.png

 

I have two formulas:

Amount = SUM(Transactions[Amt])
Sum Open = IF(MAX('Status'[Status])="Open",[Amount],BLANK())
 
Unfortunitely I have something wrong, because my "Amount" measure is doubling up and not working and also my totals are the same value which is not right because this store closed on 2/20/22... So I would expect to see "amount" listed ONCE down the rows, and Sum Open list next but the sums need to be summing properly. Sum of Open should be less than "Amount" 
 
Here is a view in Power BI... and it's not working...
 powerbignc_7-1673583336716.png

 

 What am I doing wrong, is this modeled properly, how do I write this with DAX?

1 REPLY 1
amitchandak
Super User
Super User

@powerbignc , create a combined column in both transaction table and store table

 

Date Stote = format([Date], "YYYY-MM-DD") & "-" & [Store]

 

Use the correct column from both tables and join them

 

I do not this you will need a store table in that case

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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