Forum Discussion

Narender's avatar
Narender
Resolver I
8 years ago
Solved

Need help in DAX Formula

HI All,

 

I have 2 tables .

1st is fact table and 2nd is Calender table.Both are joined with the date column in Relationships.

Below is my Dax formula which is created in New measure under the Document table(Fact Table).

 

Measure 9 =
CALCULATE(COUNT(DOCUMENT[TAX_PAYER_NO]),FILTER(ALL(DOCUMENT), DOCUMENT[Flag]="r" && DOCUMENT[TAX_TYPE_NO]=22)).

 

It is showing right data count.

But my problem is that when i  insert the Month Column of calender in axis of Bar Chart. Then it shows the same amount in each month.

 

 

Supoose my total data Count is 1000.

 

Then it shows the 1000 count for Jan , Feb, Mar ----- Dec.

 

I want to show it via Group By Month.

 

 

Thanks,

 

Narender

 

 

 

  • Anonymous's avatar
    Anonymous
    8 years ago

    Ok, you need to filter the table, but do you need the ALL function?

     

    Try this:

     

    Measure 9 =
    CALCULATE(
        COUNT(DOCUMENT[TAX_PAYER_NO]),
        DOCUMENT[Flag] = "r",
        DOCUMENT[TAX_TYPE_NO] = 22
    )

3 Replies

  • jthomson's avatar
    jthomson
    Solution Sage

    It's probably the all statement in your filter, it's then ignoring the date column, try changing that to allexcept (if you even need to have any sort of all statement in the first place)

    • Narender's avatar
      Narender
      Resolver I

      Thanks for your Reply.

       

      Actually I need to add these condition.This is like where condition.

       

      So let me know how  can I achieve my result?

       

       

      Narender

       

       

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Ok, you need to filter the table, but do you need the ALL function?

         

        Try this:

         

        Measure 9 =
        CALCULATE(
            COUNT(DOCUMENT[TAX_PAYER_NO]),
            DOCUMENT[Flag] = "r",
            DOCUMENT[TAX_TYPE_NO] = 22
        )