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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
scurrp
Frequent Visitor

DAX Bin and lag

Hi, after suggestions on approaches to solving a puzzle.

The data represents a production line product rate. Think cookies per second, measured every 5 minutes but sometimes there are gaps in sensor reading, it's not contiguous.
Occasionally the production line slows or stops due to some sort of event, failure, or lack of resources.

One of the visuals we want to look at is - on the X axis, bin the production rate into segments of 100 units with a range, 0 - 6,000. On the Y axis, count the number of times the production rate was in that segment. A second Y-axis measure is the number of downtime events that occurred while the plant was running at that rate. The data is in 2 different fact tables and have different levels of dimensionality. The common dimensions are a Date dimension and a time dimension (5 minute segments in a day) and a bin rate dimension for the segmentation.
The problem above is not the tricky part. The next question to answer is; what was the production rate at 5, 10, 15 and 20 minutes before the downtime event? The Downtime events and plant rates need to be re-segmented based on the lagged production rate. 

I've generated the unique combination of production rate bins for the different lagged rates and it's about 500K rows.
My thought was to use this as a dimension and assign a dimension key to each of the fact tables. Where this falls down is that we have multiple production lines and in one, the production rate is measured in 3 places but we look at downtime events over the whole of that process. This means 1 set of downtime events is binned by 3 different plant rates, but not at the same time.
Other plant rates have their own set of downtime data.
Production rates are not aggregated over the same or multiple production lines, they're only ever looked at in isolation.

I feel this is a DAX problem due to mixed cardinality, but it's complex given the non-contiguous rate data. The volume of data is a secondary concern and may adversely impact the performance of the visual.

EDIT : Resolved -
The time dimension was extended to the full date range of data.
The lagged production rates were added to that fact table.
Then the filter between the time dimension and the downtime event fact table was set to bi-directional (caution noted)
On the visual the Binned and Lagged Production rates now come from the Production rate fact table.
Works as expected and DAX is simple.

1 REPLY 1
v-henryk-mstf
Community Support
Community Support

Hi @scurrp ,

 

What is your specific problem and can you provide a relevant screenshot and describe it so that I can do further testing.

How to Get Your Question Answered Quickly - Microsoft Power BI Community


Looking forward to your reply.


Best Regards,
Henry

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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