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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Madhans
Frequent Visitor

Running Total Issue with DAX in Power BI (No Direct Relationship Between Tables)

Hi everyone,

I’m working on a requirement to calculate the running total for the past 6 months in Power BI. I have a DAX measure called Average_Vessels and I need to calculate the running total for the previous month.

Here’s the issue:

  • When I calculate the running total using DatesInPeriod() in the VAR A or VAR B, the calculation works fine individually.
  • However, when I attempt to divide the result (as part of a more complex calculation), the running total does not behave as expected.

Key points:

  • There is no direct relationship between the IMO_MASTER_LIST table and the Calendar table in my model.
  • The error occurs only when performing the division part of the measure. When running only the calculation without division, the running total appears correct.

Questions:

  1. Can anyone suggest why the running total works when calculated separately but not after division?
  2. How can I resolve this issue given there’s no direct relationship between the IMO_MASTER_LIST and Calendar tables?
  3. Any suggestions on how to properly calculate the running total for the last 6 months in this scenario?

    Looking forward to your insights!


WhatsApp Image 2025-01-12 at 11.48.03 AM (1).jpegimage.pngWhatsApp Image 2025-01-12 at 11.48.03 AM.jpeg

1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

Hi @Madhans 

Based on your description, you can use crossfilter() function in your measure, you can try the following.

Measure =
CALCULATE (
    [Measure],
    CROSSFILTER ( IMO_MASTER_LIST[Column], VESSEL_OFFHIRE_HOUR_SMPL[Column], BOTH )
)

You can refer to the following link to know more about the crossfilter() function.

CROSSFILTER function - DAX | Microsoft Learn

 

Best Regards!

Yolo Zhu

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

1 REPLY 1
v-xinruzhu-msft
Community Support
Community Support

Hi @Madhans 

Based on your description, you can use crossfilter() function in your measure, you can try the following.

Measure =
CALCULATE (
    [Measure],
    CROSSFILTER ( IMO_MASTER_LIST[Column], VESSEL_OFFHIRE_HOUR_SMPL[Column], BOTH )
)

You can refer to the following link to know more about the crossfilter() function.

CROSSFILTER function - DAX | Microsoft Learn

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.