cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
wanthanaj Frequent Visitor
Frequent Visitor

DAX - Count only Positive Change from Last Year ( file attached)

Hi,

 

I am trying to count how many names have positive changes from last year.


I can manage to:
1) create a measure for the Revenue from the previous year (called Revenue Last Year)
2) create a measure for the difference between 2 years (called changes
3) identify at row-level which name has positive changes (called positive count) - but pretty sure it is not correct!

 

The problem is the Total supposed to 2, not 5.... 

 

Note:

- I have read through the posts regarding Measure Totals but none of them is involved time intelligence measure like my case. (The only similar case I found, there is no solution!! )
- Hoping to see DAX solution for a calculated measure, not calculated column, please.

 

I guess it is something to do with time intelligence and blank (because some years there is no data).

Here is the pbix file  - https://drive.google.com/open?id=1psK-p7VV1-5YDP7NW-BJMVLYeB262djw

image.png

Thanks 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User IV
Super User IV

Re: DAX - Count only Positive Change from Last Year ( file attached)

Hi @wanthanaj 

 

Try the below 

positive count = 
COUNTROWS(
    FILTER(
        VALUES( Revenue[Name] ),
        [change] > 0
    )
)
Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

View solution in original post

2 REPLIES 2
Super User IV
Super User IV

Re: DAX - Count only Positive Change from Last Year ( file attached)

Hi @wanthanaj 

 

Try the below 

positive count = 
COUNTROWS(
    FILTER(
        VALUES( Revenue[Name] ),
        [change] > 0
    )
)
Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

View solution in original post

wanthanaj Frequent Visitor
Frequent Visitor

Re: DAX - Count only Positive Change from Last Year ( file attached)

Hi @Mariusz,


Thank you!!! I can't believe I didn't try that... I guess I still don't truely understand DAX.. Smiley Very Happy

 

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Top Solution Authors
Top Kudoed Authors