Forum Discussion
Anonymous
5 years agoNot applicable
Help with DAX Measure
Hi I have data similar to the below: - Marg ID can appear on multiple days - Marg ID can either go through 2 or 3 statuses per day - What I need to count is - For each day, for each Marg ID: ...
- Anonymous5 years ago
Hi Anonymous ,
Based on my test, I suggest you create a new table like this:
Then use the following formula to create measures:
1. For stacked bar chart:
count by date and type = VAR _t = ADDCOLUMNS ( DISTINCT ( SELECTCOLUMNS ( 'Data', "date", 'Data'[Date], "id", 'Data'[Marg ID] ) ), "Type", [Measure] ) RETURN COUNTX ( FILTER ( _t, [Type] = MAX ( 'Table(for legend)'[Value] ) ), [date] )2. For table:
count = CALCULATE(DISTINCTCOUNT(Data[Date]),FILTER('Data',[Measure]=MAXX('Data',[Measure])))The final output is shown below:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ashish_Mathur
5 years agoSuper User
Hi,
For that, we will have to write a calculated column formula (not a measure). Calculated column formulas do not respond to change in slicers.
Anonymous
5 years agoNot applicable
I need to eventually get to this to be able to graph it as a stacked bar chart
| Date | Auto/Manual | Count |
| 1/01/2021 | Partially Auto | 1 |
| 2/01/2021 | Partially Auto | 1 |
| 2/02/2021 | Fully Auto | 1 |
| 3/01/2021 | Manual | 1 |
| 3/01/2021 | Fully Auto | 1 |