Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

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
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

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

 

Anonymous
Not applicable

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.