Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi
I have 2 measures : Turnover and Last Year Turnover
I want to have a measure in dax
Distinct customer who have turnover this year but not last year
Disctinct customer who have turnover last year but not this year
I try
Thank you very much, this clearly shows me the results for this year and last year.
How can I modify it so that it works for each year and its previous year? whether it is dynamic?
thanks in advance
Hi, @vespa
in @Jihwan_Kim code modify like below
var _currentyear= selectedvalue(datetablename[yearcolumn])
to be more dynamic is it possible to use something to get current period et same period last year ?
Hi, I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.
please check the below picture and the attached pbix file if it suits your requirement.
EXCEPT function (DAX) - DAX | Microsoft Learn
Only this year customers count: =
VAR _currentyear =
YEAR ( TODAY () )
VAR _lastyear = _currentyear - 1
VAR _thisyearlist =
CALCULATETABLE (
SUMMARIZE ( Sales, Customer[Customer] ),
'Calendar'[Year] = _currentyear
)
VAR _prevyearlist =
CALCULATETABLE (
SUMMARIZE ( Sales, Customer[Customer] ),
'Calendar'[Year] = _lastyear
)
VAR _onlythisyearlist =
EXCEPT ( _thisyearlist, _prevyearlist )
RETURN
CALCULATE ( COUNTROWS ( Customer ), _onlythisyearlist )Only previous year customers count: =
VAR _currentyear =
YEAR ( TODAY () )
VAR _lastyear = _currentyear - 1
VAR _thisyearlist =
CALCULATETABLE (
SUMMARIZE ( Sales, Customer[Customer] ),
'Calendar'[Year] = _currentyear
)
VAR _prevyearlist =
CALCULATETABLE (
SUMMARIZE ( Sales, Customer[Customer] ),
'Calendar'[Year] = _lastyear
)
VAR _onlypreviousyearlist =
EXCEPT ( _prevyearlist, _thisyearlist )
RETURN
CALCULATE ( COUNTROWS ( Customer ), _onlypreviousyearlist )
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 65 | |
| 53 | |
| 42 | |
| 23 | |
| 22 |
| User | Count |
|---|---|
| 141 | |
| 114 | |
| 50 | |
| 37 | |
| 30 |