Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Dallas7890
Resolver I
Resolver I

Need help writing a Dax formula

Hello

I'm unsure how to combine these two amounts into one amount and then show the amount subtracted from the Perfect Monthly availability.

The Perfect Monthly is calculated in Power Query using the #of Days in each month (Jan) 31x 24x60x60 = 2678400

The Imperfect amount is the Total duration column of each Jan record - subtracted from this above Perfect Monthly amount. There are only two dates in January that our system failed. All the other months, the availability is perfect. I would like to be able to reflect this in the report below. I'm not sure how to write the DAX formula. I would like these two records for January to be combined as one total, and then subtracted from the month's January Perfect Availability amount 26784.00. 
The formula for the Monthly Perfect Availability is #of days in a Month x 24x60x60

 

Dallas7890_2-1676053550699.png

 

Dallas7890_1-1676053494581.png

 

This is currently how my report looks. It would be nice to show all the Perfect Availability Amounts and the January amounts showing the duration of, 23400 subtracted from the January's Perfect Monthly Availability. 

 

Dallas7890_3-1676053599615.png

 

Thank you kindly



 

 

 

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @Dallas7890 ,

Please try below steps:

1. below is my test table

Table:

vbinbinyumsft_0-1676526762095.png

 

Table2:

vbinbinyumsft_1-1676526785138.png

2. add a new column in Table2 with below dax formula

Total Amounts =
VAR cur_month =
    MONTH ( [Month] )
VAR tmp =
    FILTER ( 'Table', MONTH ( [Date] ) = cur_month )
VAR _val =
    SUMX ( tmp, [Duration] )
RETURN
    [Perfect Monthly Avaliability] - _val

3. add a clustered column chart visual with Table2 fields

vbinbinyumsft_2-1676526897973.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Dallas7890
Resolver I
Resolver I

Thank you so much, this is the perfect solution.

View solution in original post

2 REPLIES 2
Dallas7890
Resolver I
Resolver I

Thank you so much, this is the perfect solution.

Anonymous
Not applicable

Hi @Dallas7890 ,

Please try below steps:

1. below is my test table

Table:

vbinbinyumsft_0-1676526762095.png

 

Table2:

vbinbinyumsft_1-1676526785138.png

2. add a new column in Table2 with below dax formula

Total Amounts =
VAR cur_month =
    MONTH ( [Month] )
VAR tmp =
    FILTER ( 'Table', MONTH ( [Date] ) = cur_month )
VAR _val =
    SUMX ( tmp, [Duration] )
RETURN
    [Perfect Monthly Avaliability] - _val

3. add a clustered column chart visual with Table2 fields

vbinbinyumsft_2-1676526897973.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.