Forum Discussion

Jiangmei_wu's avatar
Jiangmei_wu
Frequent Visitor
2 years ago
Solved

Occurrence Issue

Hello,

The occurrence dax below can get the correct results with small test sample generated from real date, but when it's with real data, the resuts are incorrect. do you know why?

 
1 time =
VAR SummaryTable =
    SUMMARIZE( 'Sheet1'Sheet1'[Name]'Sheet1'[Week number],  "Occurrences",
        CALCULATE(COUNTROWS('Sheet1'),
            ALLEXCEPT('Sheet1', 'Sheet1'[Name], 'Sheet1'[Week number])))
RETURN
COUNTROWS(
    FILTER( SummaryTable,  [Occurrences] = 1))
 
Thanks, Mei
  • Jiangmei_wu's avatar
    Jiangmei_wu
    2 years ago

    Hi Neeco, please discard the request above. I found a solution as below. Thanks, Mei

     
    Names_occurred_3 =
    DIVIDE(
        CALCULATE(
        COUNTROWS('Raw Data'),
        FILTER(
            'Raw Data',
            not(ISBLANK('Raw Data'[Name])) &&
            COUNTROWS(
                FILTER(
                    'Raw Data',
                    'Raw Data'[Name] = EARLIER('Raw Data'[Name])
                )
            ) = 3
        )
    ), 3
    )

5 Replies

    • Jiangmei_wu's avatar
      Jiangmei_wu
      Frequent Visitor

      Anonymous 

      Hi Neeco, hope all is well! you have helped me resolved one problem. Hope you could squeeze some times to look into my another issue - Occurrence issue (please don't use occurrence column in Excel as it is mannually added to use for validation) which no one has been able to resolved it.

      Thanks in advance!

      Mei

      • Jiangmei_wu's avatar
        Jiangmei_wu
        Frequent Visitor

        Hi Neeco, please discard the request above. I found a solution as below. Thanks, Mei

         
        Names_occurred_3 =
        DIVIDE(
            CALCULATE(
            COUNTROWS('Raw Data'),
            FILTER(
                'Raw Data',
                not(ISBLANK('Raw Data'[Name])) &&
                COUNTROWS(
                    FILTER(
                        'Raw Data',
                        'Raw Data'[Name] = EARLIER('Raw Data'[Name])
                    )
                ) = 3
            )
        ), 3
        )