This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hello,
I have the following data structure:
Table: transactions
Ref - Subscription reference
Date - Date of the order
I want to calculate some key metrics, for example, churn rate or count of new users. To achieve this, I need to get data for the previous period and compare it to the current period. In SQL I can do left/right join but in DAX I cannot figure out how to use Except function correctly.
Looks like it works for new subscriptions, but if I cannot figure out how to change it to find lost subscriptions:
NewSubscriptions =
IF(
ISFILTERED('transactions'[Date]);
ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column.");
VAR _CURRENT = CALCULATETABLE(DISTINCT(transactions[Ref]);FILTER(transactions;transactions[Date]))
VAR _PREV = CALCULATETABLE(DISTINCT(transactions[Ref]);DATEADD('transactions'[Date].[Date]; -1; MONTH))
RETURN
COUNTROWS(EXCEPT(_CURRENT;_PREV))
)Solved! Go to Solution.
Looks like I figured out how to make it works:
NewSubscriptions =
IF(
ISFILTERED('transactions'[Date]);
ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column.");
VAR _CURRENT = CALCULATETABLE(DISTINCT(transactions[Ref]);FILTER(transactions;transactions[Date]))
VAR _PREV = CALCULATETABLE(DISTINCT(transactions[Ref]);DATEADD('transactions'[Date].[Date]; -1; MONTH))
RETURN
COUNTROWS(EXCEPT(_CURRENT;_PREV))
)LostSubscriptions =
IF(
ISFILTERED('transactions'[Date]);
ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column.");
VAR _CURRENT = CALCULATETABLE(DISTINCT(transactions[Ref]);FILTER(transactions;transactions[Date]))
VAR _PREV = CALCULATETABLE(DISTINCT(transactions[Ref]);DATEADD('transactions'[Date].[Date]; -1; MONTH))
RETURN
COUNTROWS(EXCEPT(_PREV;_CURRENT))
)
Looks like I figured out how to make it works:
NewSubscriptions =
IF(
ISFILTERED('transactions'[Date]);
ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column.");
VAR _CURRENT = CALCULATETABLE(DISTINCT(transactions[Ref]);FILTER(transactions;transactions[Date]))
VAR _PREV = CALCULATETABLE(DISTINCT(transactions[Ref]);DATEADD('transactions'[Date].[Date]; -1; MONTH))
RETURN
COUNTROWS(EXCEPT(_CURRENT;_PREV))
)LostSubscriptions =
IF(
ISFILTERED('transactions'[Date]);
ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column.");
VAR _CURRENT = CALCULATETABLE(DISTINCT(transactions[Ref]);FILTER(transactions;transactions[Date]))
VAR _PREV = CALCULATETABLE(DISTINCT(transactions[Ref]);DATEADD('transactions'[Date].[Date]; -1; MONTH))
RETURN
COUNTROWS(EXCEPT(_PREV;_CURRENT))
)
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 26 | |
| 25 | |
| 22 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 42 | |
| 41 | |
| 40 | |
| 21 | |
| 20 |