There are two possible approaches to creating the desired pie chart.
Option 1: Nested Table Calculations
In the attached workbook, I created a new worksheet that is what I understand the desired result.
This is accomplished using the calculation:
IF INDEX() = 1 THEN WINDOW_SUM(IF [Regulation] = "OK" THEN 1 END) ELSE WINDOW_SUM(IF [Regulation] = "KO" THEN 1 END) END
This looks complex, but can be thought of as doing the following....
For the first mark in the partition, sum up the number of marks where the value of Regulation is "OK", for all other marks sum up the number of marks where the value of Regulation is "KO"
We then filter using INDEX() to only show 2 marks, one for OK, and one for KO. From there, the view construction is straight forward. No dimensions on rows or columns, measure on angle. Because our "measure" in this case relies on the nested table calculations, we need the dimensions to all be on detail.
Option 2: LODs
The desired analysis can be accomplished by writing LODs for the percent of total calculations rather than using table calcs. Then using that percent of total to write an LOD that calculated OK or KO at the [Benford] level of detail. You would simply use that calculated dimension and COUNTD([Benford]) as the measure to create the pie chart.
Loi benford w pie.twbx 1.7 MB
Thanks exact what i want!!!
Sorry for correction answer quite late