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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Favourity
Regular Visitor

Counting most recent status at a point in time

I am trying to get the status for the customer application as the same time one year ago. 
Customers' application status flows through various statuses till they get either approved or declined. The statuses are given positions in descending order with dates tracking to track when each status changed. For example, when a customer applies on January 1, 2023, she/he has a status name "interest" with position 1 and on January 5 if the application is reviewed the status changes to "under-review" with that now positioned as 1, and the initial status of "interest" now 2. How is it possible to count the actual status of a customer at a point in time without counting them as duplicates  

1 ACCEPTED SOLUTION

Hi @Favourity ,

You can create a measure as below to get it:

Recent status =
VAR _appid =
    SELECTEDVALUE ( 'Table'[APPLICATIONS_ID] )
VAR _date =
    SELECTEDVALUE ( 'Table'[APPL_STATUS_DATE] ) //today()
RETURN
    CALCULATE (
        MAX ( 'Table'[APPL_STATUS] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[APPLICATIONS_ID] = _appid
                && YEAR ( 'Table'[APPL_STATUS_DATE] )
                    = YEAR ( _date ) - 1
                && MONTH ( 'Table'[APPL_STATUS_DATE] ) = MONTH ( _date )
        )
    )

If the above one can't help you figure out, please provide your expected result with backend logic and special examples base on your provided sample data. It would be helpful to find out the solution. You can refer the following link to share the required info:

How to provide sample data in the Power BI Forum

 

And it is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
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

7 REPLIES 7
some_bih
Super User
Super User

Hi @Favourity your case seems not something problematic.

To provide possible solution, please share sample data / file with inputs and expected output.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






Favourity_0-1719465841674.png

Here is a sample data. The application_ID once and reflect the most current status as at point in time. For example Applixation_ID 11502877 in  June 2023 the most current status was wait listed. I do like to automate the count with a DateDim Table

@some_bih Thanks for your contribution on this thread.

Hi @Favourity ,

Thanks for providing the sample data. I'm not clear about your requirement. Do you want to get the latest status for per application? If yes, you can create a measure as below to get it:

Measure =
VAR _appid =
    SELECTEDVALUE ( 'Table'[APPLICATIONS_ID] )
VAR _maxid =
    CALCULATE (
        MAX ( 'Table'[POS] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[APPLICATIONS_ID] = _appid )
    )
RETURN
    CALCULATE (
        MAX ( 'Table'[APPL_STATUS] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[APPLICATIONS_ID] = _appid
                && 'Table'[POS] = _maxid
        )
    )

Otherwise, please shared the expected result with the specific examples and calculation logic base on your provided sample data. If it is possible, could you please provide the sample data with Text format?

vyiruanmsft_0-1719560734427.png

Best Regards

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

APPLICATIONS_IDPOSAPPL_STATUSAPPL_STATUS_DESCAPPL_STATUS_DATEAPPL_STATUS_TIME
115028771CANNDDeposit Fee Not Received2023-09-2201:32.0
115028772OFFEROffer Issued2023-08-1956:05.0
115028773WAITWait Listed2023-05-2922:03.0
115028774WEBAPWeb Application2023-04-2845:13.0
115029771CANCICancelled - College Initiated2022-01-2835:00.0
115029772WEBAPWeb Application2021-04-2845:15.0
11503771CANSPCancelled Study Permit Denied2022-07-2218:53.0
11503772OFFEROffer Issued2021-10-1850:38.0
11503773INCAInternational Cred Assessment2021-09-2024:34.0
11503774APPLApplied2021-09-2044:08.0
115030771CANNDDeposit Fee Not Received2024-06-2116:07.0
115030772OFFEROffer Issued2024-06-1831:25.0
115030773WAITWait Listed2024-05-2713:54.0
115030774WEBAPWeb Application2024-04-2845:18.0

@v-yiruan-msft @some_bih 
Thank you for your response. To better desribe the data and question. I have added a table here and the expected outcome. 
I am looking to count the status of application IDs a year ago using 2024-06-01 reference date. So the logic are:
1. Inception to current date minus one year
2. filter based on count of Minimum value of ranking grouped by Status

 

10011A2023-10-05
10012B2023-05-28
10013C2023-04-30
10014D2023-04-12
10015E2023-01-11
10051A2024-01-01
10052B2023-11-28
10053C2023-05-30
10054D2023-05-15
10055E2023-04-30
10056F2023-04-12
10057G2023-02-28
10021A2023-11-30
10022B2023-05-12
10023C2023-04-30
10024D2023-04-12
10025E2023-01-11
10031A2024-01-01
10032B2023-11-28
10033C2023-05-30
10034D2023-05-15
10035E2023-04-30
10036F2023-04-12
10041A2023-04-30
10042B2023-01-11
10043C2022-12-28

 

Expected Result 

StatusABC
Count122

 

Reference Date: 2024-06-01

Logic needed

Inception to current date minus one year
filter based on count of Minimum value of ranking grouped by Status

Thank you for attempting. Above is a sample data in text format.
To clarify the requirement: I am looking for how to return the post-recent status for each application as of a year ago. For example, if an application was made on January 2023 with status:APPL, POS: 1 and as at June 01 2023 it is in the status: OFFER POS:1. In 2024 June Ido like to know the status the application was in June 2023. I hope I explained the requirement better. 
If you prefer I do a video that would be fine or we connet on zoom. 

Hi @Favourity ,

You can create a measure as below to get it:

Recent status =
VAR _appid =
    SELECTEDVALUE ( 'Table'[APPLICATIONS_ID] )
VAR _date =
    SELECTEDVALUE ( 'Table'[APPL_STATUS_DATE] ) //today()
RETURN
    CALCULATE (
        MAX ( 'Table'[APPL_STATUS] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[APPLICATIONS_ID] = _appid
                && YEAR ( 'Table'[APPL_STATUS_DATE] )
                    = YEAR ( _date ) - 1
                && MONTH ( 'Table'[APPL_STATUS_DATE] ) = MONTH ( _date )
        )
    )

If the above one can't help you figure out, please provide your expected result with backend logic and special examples base on your provided sample data. It would be helpful to find out the solution. You can refer the following link to share the required info:

How to provide sample data in the Power BI Forum

 

And it is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

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

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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