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
Perplexed
Frequent Visitor

Dax filter question for competitive comparison

I have some competitive data - simplified below. 

 

If I have a simple matrix with market as the rows and a slicer to allow you to choose the vendor. 

So if I choose Vendor A - the table would show Market X, Revenue 1 and then Market Y, Revenue 4. 

 

The "Home" vendor is in all markets - What measure would allow me to include the "Home" vendor  comarison revenue but only for the markets where the Vendor selection in the slicer plays. 

 

I've tried various combinations of Filter, All, AllExecpt but have not hit the right one yet. 

 

Thanks in advance for any pointers. 

 

MarketVendorsRevenue
XA1
XB2
XC5
XHome3
YA4
YD2
YE1
YHome10
ZB2
ZF6
ZG2
ZHome1
1 ACCEPTED SOLUTION
techies
Super User
Super User

Hi @Perplexed please check this

 

techies_0-1747477176785.gif

Selected Vendor Revenue =
VAR SelectedVendor = SELECTEDVALUE('Vendor Selector'[Vendor])
RETURN
CALCULATE(
    SUM('Sheet8'[Revenue]),
    'sheet8'[Vendor] = SelectedVendor
)
 
Home Vendor Comparison Revenue =
VAR SelectedVendor = SELECTEDVALUE('Vendor Selector'[Vendor])
VAR MarketsWithVendor =
    CALCULATETABLE(
        VALUES('Sheet8'[Market]),
        'Sheet8'[Vendor] = SelectedVendor
    )
RETURN
CALCULATE(
    SUM('sheet8'[Revenue]),
    'sheet8'[Vendor] = "Home",
    KEEPFILTERS(MarketsWithVendor)
)
― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978

View solution in original post

2 REPLIES 2
techies
Super User
Super User

Hi @Perplexed please check this

 

techies_0-1747477176785.gif

Selected Vendor Revenue =
VAR SelectedVendor = SELECTEDVALUE('Vendor Selector'[Vendor])
RETURN
CALCULATE(
    SUM('Sheet8'[Revenue]),
    'sheet8'[Vendor] = SelectedVendor
)
 
Home Vendor Comparison Revenue =
VAR SelectedVendor = SELECTEDVALUE('Vendor Selector'[Vendor])
VAR MarketsWithVendor =
    CALCULATETABLE(
        VALUES('Sheet8'[Market]),
        'Sheet8'[Vendor] = SelectedVendor
    )
RETURN
CALCULATE(
    SUM('sheet8'[Revenue]),
    'sheet8'[Vendor] = "Home",
    KEEPFILTERS(MarketsWithVendor)
)
― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978
DataNinja777
Super User
Super User

Hi @Perplexed ,

 

To show the "Home" vendor's revenue only in the markets where the selected vendor from the slicer appears, you'll need a measure that checks two things: whether the row is the selected vendor, or whether it's the "Home" vendor in a market where the selected vendor operates. First, use SELECTEDVALUE to capture the vendor selected in the slicer:

SelectedVendor = SELECTEDVALUE(Data[Vendor])

Next, write your main measure that filters the data based on whether the current row is for the selected vendor or for "Home" in a relevant market:

ShowRevenue =
VAR SelectedVendor = SELECTEDVALUE(Data[Vendor])
VAR CurrentVendor = MAX(Data[Vendor])
VAR CurrentMarket = MAX(Data[Market])
VAR MarketsWithSelectedVendor =
    CALCULATETABLE(
        VALUES(Data[Market]),
        Data[Vendor] = SelectedVendor
    )
RETURN
IF (
    CurrentVendor = SelectedVendor
    || (
        CurrentVendor = "Home"
        && CurrentMarket IN MarketsWithSelectedVendor
    ),
    SUM(Data[Revenue])
)

Add this measure to a matrix visual with Market and Vendor as rows and this ShowRevenue measure as values. Then, add a slicer on the Vendor field. When a vendor like "A" is selected, the matrix will show their revenues in relevant markets and also show the "Home" vendor's revenue in those same markets, ignoring all others.

 

Best regards,

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.

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.