Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Comparing data using a filter and displaying the difference

Hi,

 

I have value type date and computer

 

DateComputer

2021-09

Computer 1

2021-09

Computer 12

2021-09

Computer 2
2021-09Computer 3
2021-10Computer 1
2021-10Computer 3
2021-10Computer 4
2021-10Computer 5

 

And now, needs to compare, computers from the date 2021-09 with 2021-10 and show the difference

 

DateComputer
2021-09

Computer 12 

2021-10Computer 3
2021-10Computer 4
2021-10Computer 5

If I used 

IF(computer && weeknum(date,2)=weeknum(today(),2), 1,0 ), I get the information "Cannot convert "*" values of Text type to True/False" or how to make it show a column with the difference in computers on the date 2021-09 and a second kolumn of the difference in computers on the date 2021-10

  • Hi Anonymous,

     

    Create two calculated table as:

    2021_9 = 
    CALCULATETABLE(
        'Table',
        MONTH('Table'[Date])=9
    )
    2021_10 = 
    CALCULATETABLE(
        'Table',
        MONTH('Table'[Date])=10
    )

    Try measure as:

    Measure = 
    IF(
        MAX('Table'[Computer]) in VALUES('2021_10'[Computer]) && MAX('Table'[Computer]) in VALUES('2021_9'[Computer]),
        1,
        0
    )

    Here is the output:

    The pbix is attached.

     

    If you still have some question, please don't hesitate to let me known.‌‌

     

    Best Regards,

    Link

     

    Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

4 Replies