cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Dwisha_S
Regular Visitor

Issues with DAX Functions

Hi Community, 

I have a Sales Dashboard where I am calculating Month to Date Sales Target based on No of fullfillment Days that have passed. I am getting correct results for all months except March, June and November. The Sales Target does not change as the number of days change, it stays static. 

I have used below DAX Functions:
Monthly_Target_Till_Date = ABS(CALCULATE([Month_WorkingDaysthathavepassed]*(DIVIDE((SUM(Budget_File[Sum_of_Budget])/[Fulfillment_Days]),1))))

Month_WorkingDaysthathavepassed = CALCULATE([Fulfillment_Days]-[No.of_Working_Days_LeftInCurrent_Month])
Fulfillment_Days = CALCULATE(DISTINCTCOUNT('Date'[Day_Number_Year]),'Date'[Delivery_Days]="Working Day")
No.of_Working_Days_LeftInCurrent_Month = COUNTROWS(
    FILTER(
        CALENDAR(
            (Now()),
            EOMONTH ( NOW(), 0 )
        ),  WEEKDAY([Date], 2) < 6 && COUNTROWS(FILTER('Date','Date'[Delivery_Days]="Holiday")
    )
))


When I look at individual figures for June then it seems No.of_Working_Days_LeftInCurrent_Month is not executing properly at backend.

 

Dwisha_S_2-1685984790983.png

 

When I change it to other months then MTD Sales Target Till Date gets updated.

Dwisha_S_1-1685984764589.png

 

Please help me to resolve this issue

1 ACCEPTED SOLUTION
Dwisha_S
Regular Visitor

This issue has been resolved. I updated the && operator to  OR "||".

No.of_Working_Days_LeftInCurrent_Month = COUNTROWS(
    FILTER(
        CALENDAR(
            (Now()),
            EOMONTH ( NOW(), 0 )
        ),  WEEKDAY([Date]2) < 6 || COUNTROWS(FILTER('Date','Date'[Delivery_Days]="Holiday")
    )
))

View solution in original post

1 REPLY 1
Dwisha_S
Regular Visitor

This issue has been resolved. I updated the && operator to  OR "||".

No.of_Working_Days_LeftInCurrent_Month = COUNTROWS(
    FILTER(
        CALENDAR(
            (Now()),
            EOMONTH ( NOW(), 0 )
        ),  WEEKDAY([Date]2) < 6 || COUNTROWS(FILTER('Date','Date'[Delivery_Days]="Holiday")
    )
))

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors