locked
Use a Slicer Value in a DAX Measure RRS feed

  • Question

  • This will probably make more sense if you check out the example workbook I link to below.

    I am trying to use a slicer to select a winning Vendor, and then have that Vendor's bid total calculated by the "Selected Bid" measure. I have a disconnected table called "Bidders" with my list of Vendors loaded in PowerPivot, and then I try to capture the selected vendor from the slicer using:

    Vendor Selection:=IF(HASONEVALUE(Bidders[Selected Vendor]),VALUES(Bidders[Selected Vendor]),BLANK())

    I then try to feed the selected vendor into another measure which calculates the total bid amount for that vendor:

    Selected Bid:=CALCULATE([Bid Total],FILTER(BidTab,BidTab[Vendor]=[Vendor Selection]))

    This does not seem to be working. Any help would be greatly appreciated!

    Example workbook here: https://1drv.ms/f/s!AEGqj7Y3ClRpZw

    Friday, June 30, 2017 12:53 AM

Answers

  • Hi Aa.ron,

    Thanks for your question.

    Your DAX formula seem to be fine. In your scenario, you may need to build connection between the slice "Selected Vendor" and your report measure.

    To do this, please right click your slice "Selected Vendor" ,click on Report Connections, and select the report you want to be sliced:


    Best Regards
    Willson Yuan
    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com


    Friday, June 30, 2017 3:56 AM

All replies

  • Hi Aa.ron,

    Thanks for your question.

    Your DAX formula seem to be fine. In your scenario, you may need to build connection between the slice "Selected Vendor" and your report measure.

    To do this, please right click your slice "Selected Vendor" ,click on Report Connections, and select the report you want to be sliced:


    Best Regards
    Willson Yuan
    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com


    Friday, June 30, 2017 3:56 AM
  • Perfect - that's exactly what I was missing. Thanks Willson!

    Friday, June 30, 2017 4:35 PM