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
Anonymous
Not applicable

Calendar table to filter 2 tables that have existing Relationship aka Lapse New Trading

I have 3 tables that has ambiguous relations - where the date table filters 2 table. 

At the same time the Status Table needs to filter Fact Sales.

My attemtp to overcome this, I wrote the following DAX but did not work

Total Sales = Calculate(sum(SALES),

                    TREATEAS(SUMMARIZE(Fact Sales [CUSTOMER]),Status Table [CUSTOMER]))

The desired outcome is in Image below. thank you in advanced

 

malcolmwunOW_0-1741238296480.png

 

 

 

 

1 ACCEPTED SOLUTION
Dangar332
Super User
Super User

Hi, @Anonymous 

Try below measure

Total Sales = 
Calculate(
  sum('fact sales'[SALES]),
  TREATEAS(all(Status Table [CUSTOMER]),Fact Sales [CUSTOMER]))


If still does not work then please provide Screenshot of your data model


Best Regards,
Dangar

 

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

View solution in original post

6 REPLIES 6
v-menakakota
Community Support
Community Support

Hi @Anonymous ,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

Hi @Eisha ,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.

Thank you.

Hi @Anonymous ,

I hope the provided information by mdaatifraza5556  is  helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.

Thank you

mdaatifraza5556
Super User
Super User

Hi @Anonymous 

You can use my first approach which is using LOOKUPVALUE DAX.
OR
correct your DAXusing below DAX.

saless =
    CALCULATE(
        SUM('Fact Sales'[Sales]),
        TREATAS(VALUES('Fact Sales'[Cust]), 'Status Table'[Cust]))
mdaatifraza5556
Super User
Super User

Hi @Anonymous 
Remove the relationship between fact and status and in the fact table bring the status column using LOOKUPVALUE.
checkout the below DAX

status = LOOKUPVALUE('Status Table'[Status], 'Status Table'[MTH], 'Fact Sales'[MTH], 'Status Table'[Cust], 'Fact Sales'[Cust])

Drag the column from the calendar and the fact.


Screenshot 2025-03-06 113957.png
Dangar332
Super User
Super User

Hi, @Anonymous 

Try below measure

Total Sales = 
Calculate(
  sum('fact sales'[SALES]),
  TREATEAS(all(Status Table [CUSTOMER]),Fact Sales [CUSTOMER]))


If still does not work then please provide Screenshot of your data model


Best Regards,
Dangar

 

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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