Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi All,
I'm new to PowerBI, Please help me achive below logic
I have two table in my datamodel (Active Customer Table & Master Calendar Table)
I have Data like below Table
Active Customer Table
I want to create a DAX query for, where we will be able to see the latest Active status of all consumers for any date user will chose (date, week, month, quarter, year) . and also important that we see accumulative summary from all time before until the chosen date.
Expected Output
Data
CustomerID | Date | Active status |
A | 1/1/2020 | 1 |
B | 1/1/2020 | 1 |
C | 1/1/2020 | 1 |
D | 2/1/2020 | 1 |
A | 3/1/2020 | 0 |
B | 3/1/2020 | 0 |
B | 3/2/2020 | 1 |
B | 3/3/2020 | 0 |
E | 3/4/2020 | 1 |
D | 4/1/2020 | 0 |
A | 4/1/2020 | 1 |
B | 4/2/2020 | 1 |
Thanks,
Vengadesh P
Solved! Go to Solution.
@vengadesh_p , Try a measure like
Measure =
Countx(filter(allselected(Table, Table[CustomerID]= max(Table[CustomerID]) && Table[Date]<= max(Table[Date]) && Table[Active status] =1),[CustomerID])
-
Countx(filter(allselected(Table, Table[CustomerID]= max(Table[CustomerID]) && Table[Date]<= max(Table[Date]) && Table[Active status] =0),[CustomerID])
@amitchandak
i have modified your Query. its working fine. Thank you...
Active Customer =
COUNTX (
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[Date] <= MAX ( 'Table'[Date] ) &&
'Table'[Active status] = 1
),
'Table'[CustomerID]
)
-
COUNTX (
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[Date] <= MAX ( 'Table'[Date] ) &&
'Table'[Active status] = 0
),
'Table'[CustomerID]
)
@amitchandak
i have modified your Query. its working fine. Thank you...
Active Customer =
COUNTX (
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[Date] <= MAX ( 'Table'[Date] ) &&
'Table'[Active status] = 1
),
'Table'[CustomerID]
)
-
COUNTX (
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[Date] <= MAX ( 'Table'[Date] ) &&
'Table'[Active status] = 0
),
'Table'[CustomerID]
)
@vengadesh_p , Try a measure like
Measure =
Countx(filter(allselected(Table, Table[CustomerID]= max(Table[CustomerID]) && Table[Date]<= max(Table[Date]) && Table[Active status] =1),[CustomerID])
-
Countx(filter(allselected(Table, Table[CustomerID]= max(Table[CustomerID]) && Table[Date]<= max(Table[Date]) && Table[Active status] =0),[CustomerID])
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
92 | |
83 | |
71 | |
49 |
User | Count |
---|---|
143 | |
120 | |
110 | |
60 | |
57 |