Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello everyone,
I have a matrix with year, month and day. I would now like to see another subtotal displayed.
If possible, the intermediate result should be displayed above each day.
I've tried everything, I can't get any further.
Here is the measure used:
kaufende POS = COUNTROWS('Customers')
Here is how I imagine it:
Subtotal | 30 | |
3 Mai 2024 | 24 | |
Subtotal | 12 | |
2 Mai 2024 | 12 |
Here's the explanation as to why the subtotal is 30 after May 3rd: Because I only want to show one-time customers and not customers who have already purchased before. In other words, there are customers here who bought on May 2nd and also on May 3rd. Duplicates should not be counted twice.
If the rows are too complicated, I'm also happy with a new column. Just like the lines, this should add up the customers from the previous day and only calculate duplicates once.
If it's not possible, I would like to have the result as a column.
Thank you for any help.
Solved! Go to Solution.
@azaterol , if you are currently using one measure in matrix visual. You can use 2 and use option Switch values on rows.
the second measure can be a distinct count for the last 2 days. Prefer date table, joined with the date of your table
Rolling 2 = CALCULATE(distinctcount('Customers'[ID]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-2,day))
Hi @amitchandak ,thanks for the quick reply, I'll add more.
Hi @azaterol ,
The Table data is shown below:
Use the following DAX expression to create a measure
Measure2 =
VAR _currentDate =
SELECTEDVALUE ( 'Table'[Date] )
VAR _previousDate = _currentDate - 1
RETURN
CALCULATE (
COUNTROWS ( DISTINCT ( 'Table'[Member ID] ) ),
ALL ( 'Table'[Date] ),
'Table'[Date] >= _previousDate
&& 'Table'[Date] <= _currentDate
)
Final output
Best Regards,
Wenbin Zhou
Hi @amitchandak ,thanks for the quick reply, I'll add more.
Hi @azaterol ,
The Table data is shown below:
Use the following DAX expression to create a measure
Measure2 =
VAR _currentDate =
SELECTEDVALUE ( 'Table'[Date] )
VAR _previousDate = _currentDate - 1
RETURN
CALCULATE (
COUNTROWS ( DISTINCT ( 'Table'[Member ID] ) ),
ALL ( 'Table'[Date] ),
'Table'[Date] >= _previousDate
&& 'Table'[Date] <= _currentDate
)
Final output
Best Regards,
Wenbin Zhou
@azaterol , if you are currently using one measure in matrix visual. You can use 2 and use option Switch values on rows.
the second measure can be a distinct count for the last 2 days. Prefer date table, joined with the date of your table
Rolling 2 = CALCULATE(distinctcount('Customers'[ID]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-2,day))
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
116 | |
103 | |
87 | |
35 | |
35 |
User | Count |
---|---|
152 | |
98 | |
81 | |
61 | |
55 |