Forum Discussion

swarnalvr's avatar
swarnalvr
Frequent Visitor
1 year ago
Solved

Dax measure

Hi 

I am using matrix table and there is sales1 and sales2, iam dynamically selecting those measures from drop down slicer

I have used "difference "= sales1-sales2 which runs when both are selected from drop down colums..

 

I want show difference to" blank"when sales2 not selected  in the table from the drop using measure

 

Used difference = if(isblank(sales2),blank(),sales1- sales2

But not getting blank value when there is no sales2 measure in the table

 

  • BeaBF's avatar
    BeaBF
    1 year ago

    swarnalvr ok, so try with:

    Difference =
    IF(
    ISINSCOPE(Sales2),
    Sales1 - Sales2,
    BLANK()
    )

     

    BBF

4 Replies

  • BeaBF's avatar
    BeaBF
    Super User

    swarnalvr Hi! try with:

    Difference =
    IF(
    NOT ISBLANK(SELECTEDVALUE(Sales2)),
    Sales1 - Sales2,
    BLANK()
    )

     

    BBF

    • swarnalvr's avatar
      swarnalvr
      Frequent Visitor

      Thanks but both sales1 and sales 2 are measures..so selected value not working

      • BeaBF's avatar
        BeaBF
        Super User

        swarnalvr ok, so try with:

        Difference =
        IF(
        ISINSCOPE(Sales2),
        Sales1 - Sales2,
        BLANK()
        )

         

        BBF