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
vjnvinod
Impactful Individual
Impactful Individual

DAX Help

Dear Experts,

 

I'm building a Power BI matrix that compares peer clients against a selected client's service offerings. The goal is to identify which peers have or don’t have the same offerings as the selected client, and flag those gaps as potential cross-sell opportunities
 
Data Model:
  • Pipeline table with columns: Prospect Client Name, Service Offering, Total Value Of Potential Sale.
  • ClientSlicerTable (disconnected from the Pipeline table) used to select a single client.)
  • Peer clients are filtered using a PeerFilter measure (same sector, excluding selected client) which is set to 1 based on the below measure
    PeerFilter =
    VAR _selectedClient = SELECTEDVALUE( ClientSlicerTable[Prospect Client Name] )
    VAR _selectedSector = CALCULATE(
        MAX( Pipeline[Client Sector] ),
        ALL( Pipeline ),
        Pipeline[Prospect Client Name] = _selectedClient
    )
    VAR _rowSector = MAX( Pipeline[Client Sector] )
    VAR _rowClient = MAX( Pipeline[Prospect Client Name] )
    RETURN
        IF( NOT ISBLANK(_selectedClient) &&
            _rowSector = _selectedSector &&
            _rowClient <> _selectedClient,
            1,
            0
        )
     
    I need to display the potential cross-selling value for peer clients who currently have no sales (blank or 0) for service offerings that the selected client already has. The goal is to identify where peers are missing offerings that the selected client provides, and estimate the potential value they could generate if they adopted those offerings
  • to do that i have used the below measure 
    CrossSellSales_Final =
    VAR _selectedClient = SELECTEDVALUE( ClientSlicerTable[Prospect Client Name] )
    VAR _currOffering   = SELECTEDVALUE( Pipeline[Service Offering] )
    VAR _selectedHasOffer =
        CALCULATE(
            COUNTROWS( Pipeline ),
            REMOVEFILTERS( Pipeline[Prospect Client Name] ),       -- ignore current peer filter
            Pipeline[Prospect Client Name] = _selectedClient,
            Pipeline[Service Offering]    = _currOffering
        )
    VAR _peerSales = [sales]
    VAR _baseResult =
        IF( ISBLANK( _selectedClient ), BLANK(),
            IF( _selectedHasOffer = 0, BLANK(),
                IF( NOT ISBLANK( _peerSales ), _peerSales, 0 )
            )
        )
    RETURN
        _baseResult,  this measure doesn't give me what i am looking for
     
    vjnvinod_0-1766131352334.png

    in the above example Financial statemnt audit and Financial Statement review are the sales offerings for ANB capital but in peer Client table, i only want to see, if peer client doesn't have both or one of the offerings, their potential sales value should be picked from the first table of Selected clients.

    I hope i was able to explain the requirement, might be a small dax fix in my current dax measure, would be great to get some support

 

1 ACCEPTED SOLUTION
vjnvinod
Impactful Individual
Impactful Individual

Finally figured it out 

 

CrossSell (Only fill from selected when peer blank) =

VAR SelectedClient = SELECTEDVALUE ( 'ClientSlicerTable'[Prospect Client Name] )

VAR RowClient      = SELECTEDVALUE ( 'MatrixPeers'[Prospect Client Name] )

VAR CurrOffering   = SELECTEDVALUE ( 'Pipeline'[Service Offering] )

RETURN

IF (

    NOT ISINSCOPE('MatrixPeers'[Prospect Client Name]) || NOT ISINSCOPE('Pipeline'[Service Offering]),

    BLANK(),

    VAR SelectedSector =

        CALCULATE ( MAX('Pipeline'[Client Sector]), REMOVEFILTERS('Pipeline'),

            TREATAS({SelectedClient}, 'Pipeline'[Prospect Client Name]) )

    VAR RowSector =

        CALCULATE ( MAX('Pipeline'[Client Sector]), REMOVEFILTERS('Pipeline'),

            TREATAS({RowClient}, 'Pipeline'[Prospect Client Name]) )

    VAR PeerSales =

        CALCULATE ( [sales], REMOVEFILTERS('Pipeline'),

            TREATAS({RowClient}, 'Pipeline'[Prospect Client Name]),

            TREATAS({CurrOffering}, 'Pipeline'[Service Offering]) )

    VAR SelectedClientSalesForThisOffering =

        CALCULATE ( [sales], REMOVEFILTERS('Pipeline'),

            TREATAS({SelectedClient}, 'Pipeline'[Prospect Client Name]),

            TREATAS({CurrOffering}, 'Pipeline'[Service Offering]) )

    RETURN

        IF (

            RowClient = SelectedClient || RowSector <> SelectedSector || ISBLANK(SelectedSector),

            BLANK(),

            IF ( ISBLANK(PeerSales), SelectedClientSalesForThisOffering, BLANK() )

        )

)

View solution in original post

23 REPLIES 23

@grazitti_sapna 

 

thank you, but unfortunately dax still doesn't work, for example in the below view for Peer client Abhudhabi Global market  doesn't have sales in RI-Financial Crimes, so it should pick up the value from selected clients sales value from RI-Financial crimes, in this case $45K, so this $45K becomes potential cross selling opportunity?

Not sure if i am able to explain this

 

 

vjnvinod_0-1766141670467.png

 

@vjnvinod , Have two measures like below, use the second measure M2 with ClientSlicerTable or pipeline Prospect Client Name

 

 

M1 =
VAR _selectedClient = SELECTEDVALUE( ClientSlicerTable[Prospect Client Name] )
_tab = summarize(filter(Pipeline, Pipeline[Prospect Client Name] = _selectedClient ), Pipeline[Client Sector] )
return
Countrows(filter(Pipeline, Pipeline[Client Sector] in _tab))


M2 = Countx(values(ClientSlicerTable[Prospect Client Name]) , If(ISBLANK([M1]),[Prospect Client Name], blank()))

 

or

 

 

M2 = Countx(values(Pipeline[Prospect Client Name] ) , If(ISBLANK([M1]),[Prospect Client Name], blank()))

 

If both tables are joined first one should work. Else try second M1

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

  

Looks like there is some logical issue, unfortunately even co pilot is not putting the right solution

 

M1 measure

M1 =
VAR _selectedClient = SELECTEDVALUE( ClientSlicerTable[Prospect Client Name] )
_tab = summarize(filter(Pipeline, Pipeline[Prospect Client Name] = _selectedClient ), Pipeline[Client Sector] )
return
Countrows(filter(Pipeline, Pipeline[Client Sector] in _tab))

 

 

The syntax for '_tab' is incorrect. (DAX(VAR _selectedClient = SELECTEDVALUE( ClientSlicerTable[Prospect Client Name] )_tab = summarize(filter(Pipeline, Pipeline[Prospect Client Name] = _selectedClient ), Pipeline[Client Sector] )returnCountrows(filter(Pipeline, Pipeline[Client Sector] in _tab)))).

 

what copilot is giving is

 

M1 =
VAR _selectedClient =
    SELECTEDVALUE ( ClientSlicerTable[Prospect Client Name] )
VAR _tab =
    CALCULATETABLE (
        VALUES ( Pipeline[Client Sector] ),
        FILTER ( Pipeline, Pipeline[Prospect Client Name] = _selectedClient )
    )
RETURN
COUNTROWS (
    FILTER ( Pipeline, Pipeline[Client Sector] IN _tab )
)

 

@amitchandak

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.