Forum Discussion

JothiG's avatar
JothiG
Helper III
6 months ago
Solved

Dax correction

CALCULATE( COUNTROWS ( VW_Holiday_details) ,ALL(VW_Holiday_details[fin_year])) --this dax is not working correctly  
-- result should be 19 rows but result is 16 rows . 
sample data here
div_codedatedescriptionshortdescdel_statusHoliday_TypeStatecodefin_year
12024-04-19 00:00:00.000LOK SABHA ELECTION DAY 2024ELECTNN12024
12024-05-01 00:00:00.000MAY DAYMAY1NN12024
12024-08-15 00:00:00.000INDEPENDENCE DAYAUG15NN12024
12024-10-02 00:00:00.000GANDHI JAYANTHIOCT2NN12024
12024-10-30 00:00:00.000DEEPAVALIDEEPANF12024
12024-10-31 00:00:00.000DEEPAVALIDEEPANF12024
12024-11-01 00:00:00.000DEEPAVALIDIWALNF12024
12025-01-14 00:00:00.000PONGALPONGANF12024
12025-01-15 00:00:00.000PONGALPONGANF12024
12025-01-26 00:00:00.000REPUBLIC DAYREPUBNN12024
12025-04-14 00:00:00.000TAMIL NEW YEARTAMILNF12025
12025-05-01 00:00:00.000MAY DAYMAY 1NN12025
12025-08-15 00:00:00.000INDEPENDENCE DAYAUG24NN12025
12025-10-02 00:00:00.000GANDHI JAYANTHIOCT2NN12025
12025-10-20 00:00:00.000DEEPAWALIDEEPANF12025
12025-10-21 00:00:00.000DEEPAWALIDEEPANF12025
12026-01-15 00:00:00.000PONGALPONGANF12025
12026-01-16 00:00:00.000PONGALPONGANF12025
12026-01-26 00:00:00.000REPUBILC DAYJAN26NN12025

9 Replies

  • Hi JothiG 

     

    If your intention is to count all rows ignoring all filters, then remove field [fin_year] from ALL argument and check the count.

     

  • please try CALCULATECOUNTROWS ( VW_Holiday_details) ,ALL(VW_Holiday_details)) 
    And if you want to keep filters from other viz:
    CALCULATE( COUNTROWS ( VW_Holiday_details) ,ALLSELECTED(VW_Holiday_details))

    • pcoley's avatar
      pcoley
      Super User

      I think you have some other filters pointing your viz. to remove all filters please try with this formula:

      CALCULATECOUNTROWS ( VW_Holiday_details) ,ALL()) 

      I hope this helps. if so please mark it as a solution. kudos are welcome.

  • Hi,

    Why are you using the ALL() function there?  Why not just this?

    =CALCULATECOUNTROWS ( VW_Holiday_details)

  • v-karpurapud's avatar
    v-karpurapud
    Community Support

    Hi JothiG 

    Thank you for posting your query in the Microsoft Fabric Community Forum, and thanks to krishnakanth240 , Ashish_Mathur and pcoley  for sharing valuable insights.

     

    Could you please confirm if your query has been resolved by the provided solution?If you have any more questions, please let us know and we’ll be happy to help.

    Regards,

    Microsoft Fabric Community Support Team

     

  • Hi JothiG 

     

    If your intention is to count all rows ignoring all filters, then remove field [fin_year] from ALL argument and check the count.

     

    • JothiG's avatar
      JothiG
      Helper III
      CALCULATE( COUNTROWS ( VW_Holiday_details ),ALL(VW_Holiday_details)) --this is also gives 16 rows.
  • v-karpurapud's avatar
    v-karpurapud
    Community Support

    Hi JothiG 

    We would like to confirm whether the issue has been resolved. If it is still outstanding, please share any additional information so we can assist you further.

    Thank you.