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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I need to create 2 measures.
Sample data below:
| Date | Item ID |
| 02.10.2020 (today) | A |
| 02.10.2020 | B |
| 02.10.2020 | C |
| 01.10.2020 | B |
| 28.09.2020 | C |
| 27.09.2020 | C |
Solved! Go to Solution.
Hello @pawelj795 ,
Please try this:
Measure 1 =
var t1_=
CALCULATETABLE (
VALUES ( 'Table'[Item ID] ),
FILTER (
ALL ( 'Table'[Date] ),
'Table'[Date] < MAX('Table'[Date]) )
)
var t2_=
CALCULATETABLE (
VALUES ( 'Table'[Item ID] ),
FILTER (
ALL ( 'Table'[Date] ),
'Table'[Date] = MAX('Table'[Date]) )
)
return
COUNTROWS(INTERSECT(t1_,t2_))Measure 2 = CALCULATE(COUNT('Table'[Date]),ALLEXCEPT('Table','Table'[Item ID]))
Hello @pawelj795 ,
Please try this:
Measure 1 =
var t1_=
CALCULATETABLE (
VALUES ( 'Table'[Item ID] ),
FILTER (
ALL ( 'Table'[Date] ),
'Table'[Date] < MAX('Table'[Date]) )
)
var t2_=
CALCULATETABLE (
VALUES ( 'Table'[Item ID] ),
FILTER (
ALL ( 'Table'[Date] ),
'Table'[Date] = MAX('Table'[Date]) )
)
return
COUNTROWS(INTERSECT(t1_,t2_))Measure 2 = CALCULATE(COUNT('Table'[Date]),ALLEXCEPT('Table','Table'[Item ID]))
The information you have provided is not making the problem clear to me. Can you please explain with an example.
These can be two measures what I can get from a high level
calculate(distinctcount(Table[Item ID]), Table[Date] =today())
calculate(distinctcount(Table[Item ID]), Table[Date] < today())
Appreciate your Kudos.
Hi @amitchandak
Alluding to my above sample, I explain what I meant.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 36 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 74 | |
| 66 | |
| 65 |