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
Anonymous
Not applicable

Counting Net New and Net Loss

Every week I receive a report on the current expired payments.  If the payment showed up in 2/2/2022 and 2/9/2022 you know it remained expired, however if it doesnt show up in the 2/16/22 file you know that it was solved/processed so I would count that as 1 processed payment. 

 

In the below example payment abc and def were processed because they stopped appearing, xyz is still unprocessed so the total number of processed payments is 2.

 

Is there a measure or conditional column I can create to do this counting (comparing this week to last week) to see how many were closed or how many new expired payments appeared?

 

 

 

File DateUnique Payment IDPrimary Key (Merged Column)
2 16 2022xyz2 16 2022xyz
2 9 2022xyz2 9 2022xyz
2 2 2022xyz2 2 2022xyz
2 9 2022abc2 9 2022abc
2 2 2022abc2 2 2022abc
2 2 2022def2 2 2022def

 

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

Hi @Anonymous ,

 

Check the formulas.

this_week = 
var _thisweek = WEEKNUM(TODAY())
var thisweek_ids = CALCULATETABLE(VALUES('Table'[Unique Payment ID]),FILTER(ALLSELECTED('Table'),WEEKNUM('Table'[File Date])=_thisweek))
return
CALCULATE(DISTINCTCOUNT('Table'[Unique Payment ID]),FILTER(ALLSELECTED('Table'),NOT('Table'[Unique Payment ID] in thisweek_ids)))

last_week = 
var _thisweek = WEEKNUM(TODAY())
var thisweek_ids = CALCULATETABLE(VALUES('Table'[Unique Payment ID]),FILTER(ALLSELECTED('Table'),WEEKNUM('Table'[File Date])=_thisweek-1))
return
CALCULATE(DISTINCTCOUNT('Table'[Unique Payment ID]),FILTER(ALLSELECTED('Table'),NOT('Table'[Unique Payment ID] in thisweek_ids)))

 1.PNG

 

Best Regards,

Jay

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

View solution in original post

4 REPLIES 4
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

Check the formulas.

this_week = 
var _thisweek = WEEKNUM(TODAY())
var thisweek_ids = CALCULATETABLE(VALUES('Table'[Unique Payment ID]),FILTER(ALLSELECTED('Table'),WEEKNUM('Table'[File Date])=_thisweek))
return
CALCULATE(DISTINCTCOUNT('Table'[Unique Payment ID]),FILTER(ALLSELECTED('Table'),NOT('Table'[Unique Payment ID] in thisweek_ids)))

last_week = 
var _thisweek = WEEKNUM(TODAY())
var thisweek_ids = CALCULATETABLE(VALUES('Table'[Unique Payment ID]),FILTER(ALLSELECTED('Table'),WEEKNUM('Table'[File Date])=_thisweek-1))
return
CALCULATE(DISTINCTCOUNT('Table'[Unique Payment ID]),FILTER(ALLSELECTED('Table'),NOT('Table'[Unique Payment ID] in thisweek_ids)))

 1.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Whitewater100
Solution Sage
Solution Sage

Hello:

 

I made a file with a date table that should handle your request for now. It's a bit easier to follow, for me..

Hope this helps!https://drive.google.com/file/d/1eZcMF1Gov88AA1wzOi53tiHRF4Q1aoTD/view?usp=sharing 

CNENFRNL
Community Champion
Community Champion

Seemingly simple question, is in fact tricky enough to kick out 99% rookies and medium DAX learners,

CNENFRNL_0-1645280801316.png

 


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Russell-PBI
Resolver II
Resolver II

Hi @Anonymous, does this work?:

Unprocessed = 
VAR MaxDate = CALCULATE(MAX('Table'[File Date]), ALL('Table'))
VAR Unprocessed = CALCULATE(
DISTINCTCOUNT('Table'[Unique Payment ID])
, 'Table'[File Date] = MaxDate
)
RETURN
IF(ISBLANK(Unprocessed), 0, Unprocessed)

Processed =
DISTINCTCOUNT('Table'[Unique Payment ID]) - [Unprocessed]

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.