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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
gvg
Post Prodigy
Post Prodigy

How to remove filters from the fact table keeping filters on the dimension table?

Hi folks,

 

I am looking for any hint for this unusual scenario. I have Products (dimension) and Sales (fact) tables that are related through 1-many relationship. If I use ALL(Sales) in my measure, it removes filters not only from Sales, but from the Products table too. How do I remove filters for the Sales table only?

1 ACCEPTED SOLUTION

Hi

@parry2k , thanks for your concern about the problem and i want to offer some more information for user to refer to. 

hello @gvg , you can refer to the following solution.

Sample data

Sales

vxinruzhumsft_0-1718004041700.png

Product

vxinruzhumsft_1-1718004070648.png

Calendar table

vxinruzhumsft_2-1718004093041.png

Relationship

vxinruzhumsft_3-1718004126974.png

 

Create a measure

Sum_greencolor =
IF (
    SUM ( Sales[Amount] ) <> BLANK (),
    CALCULATE (
        SUM ( Sales[Amount] ),
        ALLEXCEPT ( Sales, Products[Title], 'Calendar'[Week] ),
        Sales[Color] = "green"
    )
)

Output

vxinruzhumsft_4-1718004277747.png

 

Best Regards!

Yolo Zhu

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

4 REPLIES 4
parry2k
Super User
Super User

@gvg I'm still not able to understand the problem you are trying to solve, you just gave the structure of the tables and the output, but not sure what problem we are solving here.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

gvg
Post Prodigy
Post Prodigy

My problem is that I have to work with unusual data tables were some dimensions are in the fact tables. This is a simplified example of my tables:

 

Products[ID]Products[Title]

 

Sales[Date]Sales[Color]Sales[Amount]

 

I need to produce the report like this:

Products[Title]Week NoSales[Color]Sales[Amount]Sales[Color]=green
abc12Red100005000
cde12Black40005000

Hi

@parry2k , thanks for your concern about the problem and i want to offer some more information for user to refer to. 

hello @gvg , you can refer to the following solution.

Sample data

Sales

vxinruzhumsft_0-1718004041700.png

Product

vxinruzhumsft_1-1718004070648.png

Calendar table

vxinruzhumsft_2-1718004093041.png

Relationship

vxinruzhumsft_3-1718004126974.png

 

Create a measure

Sum_greencolor =
IF (
    SUM ( Sales[Amount] ) <> BLANK (),
    CALCULATE (
        SUM ( Sales[Amount] ),
        ALLEXCEPT ( Sales, Products[Title], 'Calendar'[Week] ),
        Sales[Color] = "green"
    )
)

Output

vxinruzhumsft_4-1718004277747.png

 

Best Regards!

Yolo Zhu

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

parry2k
Super User
Super User

@gvg what are you trying to achieve? What is your end goal?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!