Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
99 | |
76 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |