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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
jadyferreira
Regular Visitor

Last product status for the filtered month

Hello,

My current problem is that I need a dax to return my KPI value, based only on products with "active" status for each customer.

 

The big problem is that it recognizes two different status for one product, active and inactive. So, as all products appear as actives, these impact my calculation. I need that my dax to recognize the last status of one product, for X month and X customer, to return only the value related to the active products.

I try this, but doesn't work (The red part is the problem):


% STOCK =

var Cliente = SELECTEDVALUE('Bridge Clientes'[Cliente])

Return

IF(Cliente = BLANK(),
[STOCK],

calculate(
[STOCK],
'OSA Total'[Cliente] = Cliente,
'BaseSKU'[Sales Status] = "Active",
'BaseSKU'[SKU Status] = "Regular",
'Status EAN Total'[Status] = "Active"
)
)



1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @jadyferreira ,

According to your description, can't directly create a sample to reproduce your problem, but based on my understanding, every product has a status "active", you just want to see if the last status is active. If you define the last by date, you can modify the red part like this:

MAXX (
        FILTER (
            ALL ( 'Status EAN Total' ),
            'Status EAN Total'[Date]
                = MAXX ( ALL ( 'Status EAN Total' ), 'Status EAN Total'[Date] )
        ),
        'Status EAN Total'[Status]
    ) = "Active"

You can adjust the formula accordingly with your data.

 

Best Regards,
Community Support Team _ kalyj

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

View solution in original post

2 REPLIES 2
v-yanjiang-msft
Community Support
Community Support

Hi @jadyferreira ,

Is your problem solved? If so, would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirment will find the solution quickly and benefit here, thank you!

Best Regards,
Community Support Team _ kalyj

v-yanjiang-msft
Community Support
Community Support

Hi @jadyferreira ,

According to your description, can't directly create a sample to reproduce your problem, but based on my understanding, every product has a status "active", you just want to see if the last status is active. If you define the last by date, you can modify the red part like this:

MAXX (
        FILTER (
            ALL ( 'Status EAN Total' ),
            'Status EAN Total'[Date]
                = MAXX ( ALL ( 'Status EAN Total' ), 'Status EAN Total'[Date] )
        ),
        'Status EAN Total'[Status]
    ) = "Active"

You can adjust the formula accordingly with your data.

 

Best Regards,
Community Support Team _ kalyj

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.