Forum Discussion
micmat
6 years agoRegular Visitor
Ignore Value if no date
| Date | Location | Product | Value |
| 11/25/2019 | US | A | 20 |
| 11/25/2019 | US | B | 30 |
| 11/26/2019 | US | A | 50 |
| 11/27/2019 | US | A | 30 |
| 11/27/2019 | US | B | 60 |
Hey all, so what I would like to do is have the chart show the value of Product B - Product A, but only if they both have a given date. So:
11/25/2019 : 10
11/26/2019: Show nothing (no line) since there is no product B for that date
11/27/2019: 30
I tried using some NOT(ISBLANK()) logic but it made my charts look off and not the correct results. Thanks for any help!
micmat I did with following measures
Total Value = SUM ( 'Table (2)'[Value] ) Product A Value = CALCULATE ( [Total Value], 'Table (2)'[Product] = "A" ) Product B Value = CALCULATE ( [Total Value], 'Table (2)'[Product] = "B" ) Product B - Product A = IF ( [Product A Value] = BLANK() || [Product B Value] == BLANK(), BLANK(), [Product B Value] - [Product A Value] )Use bar chat, drop date on X-Axis and Product B - Product A on value section
4 Replies
- parry2k
Super User
- parry2k
Super User
micmat I did with following measures
Total Value = SUM ( 'Table (2)'[Value] ) Product A Value = CALCULATE ( [Total Value], 'Table (2)'[Product] = "A" ) Product B Value = CALCULATE ( [Total Value], 'Table (2)'[Product] = "B" ) Product B - Product A = IF ( [Product A Value] = BLANK() || [Product B Value] == BLANK(), BLANK(), [Product B Value] - [Product A Value] )Use bar chat, drop date on X-Axis and Product B - Product A on value section
- micmatRegular Visitor
Thank you!
- micmatRegular Visitor
That is exactly it! How were you able to do it?