Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

shown true or false by date filter

Hi, 

I have the table name total value

TimestampValueCategory
5/6/225A
5/6/228A
5/6/229B
7/6/221C
7/6/2214A

 

I using this dax for summaries table,

 

total value table =sum(total value[value])

Daily = SUMMARIZE(total value,total value[Timestamp],total value[Category],"Value",[Total value table])

yesorno = SWITCH(TRUE(),'Daily'[Category]="A"&&'Daily'[Value]>13,TRUE,'Daily'[Category]="A"&&'Daily'[Value]<=13,FALSE,BLANK())

 

 

In the result should 

TimestampCategoryyesorno
5/6/22AFalse
5/6/22BBlank 
7/6/22CBlank 
7/6/22ATrue

 

How should I create the card if I have a date filter, I want to shown False for the day I selected (5/6/22)  and True for the day (7/6/22). 

 

I tried to input the yesorno into card but it shown the count of yesorno. 

 

Thanks for your help. 

  • Hi Anonymous 

     

    Please try following DAX:

     

    yesorno = SWITCH(
        TRUE(),
        'Daily'[Category] = "A" && 'Daily'[Value] > 13, "TRUE",
        'Daily'[Category]="A" && 'Daily'[Value] <=13, "FALSE")

     

    Then you can get result you want.

     

    Best regards,

    Yadong Fang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    I would like to show the result of A only, and if A is true and false then always true. 

     

    Thanks for your help. 

  • v-yadongf-msft's avatar
    v-yadongf-msft
    Icon for Community Support rankCommunity Support

    Hi Anonymous 

     

    Please try following DAX:

     

    yesorno = SWITCH(
        TRUE(),
        'Daily'[Category] = "A" && 'Daily'[Value] > 13, "TRUE",
        'Daily'[Category]="A" && 'Daily'[Value] <=13, "FALSE")

     

    Then you can get result you want.

     

    Best regards,

    Yadong Fang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.