Forum Discussion
showard40k
1 year agoRegular Visitor
Unique number column
Unique number column I have the following column of occurrences ranging from 1 to 5. What DAX do I need in my measure to capture the frequency of each number? I also want to report the total, and...
- 1 year ago
Hi,
These measures work
Measure = COUNTROWS(Corrected)Measure 2 = CALCULATE([Measure],ALL(Corrected[Occurrence]))Measure 3 = DIVIDE([Measure],[Measure 2])Hope this helps.
Anonymous
1 year agoNot applicable
Hi showard40k ,
I think you can also create a new table to achieve your requirements.
Firstly I create a table as you mentioned.
Then I think you can create a new table and try this DAX code.
NewTable =
VAR TotalCount =
COUNTROWS ( 'Corrected' )
RETURN
ADDCOLUMNS (
SUMMARIZE ( 'Corrected', 'Corrected'[Occurrence] ),
"Frequency",
COUNTX (
FILTER (
'Corrected',
'Corrected'[Occurrence] = EARLIER ( 'Corrected'[Occurrence] )
),
'Corrected'[Occurrence]
),
"Percentage",
FORMAT (
COUNTX (
FILTER (
'Corrected',
'Corrected'[Occurrence] = EARLIER ( 'Corrected'[Occurrence] )
),
'Corrected'[Occurrence]
) / TotalCount,
"0.00%"
)
)
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
samuelhoward
1 year agoFrequent Visitor
Hi v-yilong-msft
Unfortunately, I get the following error when using your code. Any thoughts?