Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi All,
In my report, there is a Slicer of "Shop"
I am trying to write a DAX to count how many customers with these critirias:
1.) The customers's first transaction is from the Shop Slicer (Assuming "A") --> 2 cutomers
2.) Later on, those customers have transaction in Shop B --> 1 customer
ID | Transaction Date | Shop |
1 | Jan 1 2022 | A |
1 | Feb 1 2022 | B |
1 | May 1 2022 | C |
2 | Jan 1 2022 | A |
2 | Feb 1 2022 | C |
3 | Jan 1 2022 | B |
3 | Feb 1 2022 | A |
May I ask how it is possible to get the answer "1" by using DAX or calculated column?
Hi @Anonymous ,
Here are the steps you can follow:
1. Create measure.
Measure =
var _select=SELECTEDVALUE('Table'[Shop])
return
COUNTX(FILTER(ALL('Table'),
'Table'[ID]<=2 && 'Table'[Shop]=_select),[Shop])
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
@v-yangliu-msft thanks but sorry that I am not so clear.
I am hoping to count the customer who
1.) first transaction in shop A (which is depended on the slicer)
2.) for those whose first transaction in shop A, how many of them later on, have transaction in shop B (Shop B is required)
Thanks in advance
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
99 | |
68 | |
44 | |
38 | |
29 |
User | Count |
---|---|
156 | |
92 | |
61 | |
44 | |
42 |