Forum Discussion

Decter3343's avatar
Decter3343
Frequent Visitor
3 years ago
Solved

Calculate each values in slicer selection

Hi.   Let me explain current my concern.  please, find below picture.   there is two part. first, i select potential Vendor with slicer. if i select three vendors, i can find these vendors...
  • MFelix's avatar
    MFelix
    3 years ago

    So for this you want to pick up 5 vendors and apply to those the parameters correct?

     

    I assume you have a table for vendors (dimension and another with the fact tables and a measure that you are using to be changed. 

     

    Create the following measure:

    Total adjusted = 
    VAR test =
        CALCULATE (
            COUNTROWS ( ALLSELECTED ( 'Vendors' ) ),
            FILTER (
                ALLSELECTED ( 'Vendors'[Vendor] ),
                'Vendors'[Vendor] <= MAX ( 'Vendors'[Vendor] )
            )
        )
    RETURN
        SWITCH (
            test,
            1, [Total Sales]+ [Vendor1 Parameter Value],
            2, [Total Sales] + [Vendor 2 Parameter Value],
           [Total Sales]
        )

     

    In this case I only have two but you can have 5 or more:

     

    Check PBIX file attach.