Forum Discussion

Govardhan118's avatar
Govardhan118
New Member
2 years ago

Measure

I have inserted a table in Power BI report. Just 2 columns "Total Sales" and "February Sales". The DAX measures for these are as follows-
Total Sales =
SUM('sales'[amount])
February Sales =
CALCULATE(Total Sales, FILTER(ALL(calendar), 'calendar'[month] = 2))


I must say that I am new to Power BI, started learning it recently.
I want to ask, is there any error in my DAX? I do not have any page-level or visual-leve filters.
For some reason, the "Total Sales" and "February Sales" are one and the same. No change in numbers. Can someone help me with this. I am unable to figure out what is wrong. For context, I downloaded the Desktop app from the Store. I don't know how this information helps, but is the issue that the app is not functioning?

 

5 Replies

    • Govardhan118's avatar
      Govardhan118
      New Member

      I did. I checked the values returned by the 2 measures. They both are the same, I even checked it for different years, they were the same.
      I do want to ask, is my DAX Code correct? I am trying to understand how filter modifying functions work. There is a one-to-many relationship between the 'calendar' table (dates table) and the 'sales' table, with 'sales' being on the many side of the relationship.

       

      • mickey64's avatar
        mickey64
        Super User

        Most of the time I use this formula.

            February Sales = SUMX(FILTER('sales','calendar'[month]=2),sales'[amount])

         

        Please try that formula below, too.

            February Sales = CALCULATE(Total Sales, 'calendar'[month] = 2)