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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
ScottBrown
Helper I
Helper I

DAX Help - Partially created from Time Intelligence

I need filtering this down a little further,

  • Need to filter the weekIndex to be greater than or equal to -20
  • How do I round the answer = currently is 22.67 which is correct
AVG Weekly Production Last 20 Wks =
AVERAGEX(
    KEEPFILTERS(VALUES('DimDates'[weekIndex])),
    CALCULATE(COUNT('Production_Stock_OrderLines_HIST-PROD'[txtOrdNo])
))
 
Thnaks in Advance
1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

Is this what you mean?

AVG Weekly Production Last 20 Wks =
ROUND (
    AVERAGEX (
        FILTER ( VALUES ( 'DimDates'[weekIndex] ), 'DimDates'[weekIndex] >= -20 ),
        CALCULATE ( COUNT ( 'Production_Stock_OrderLines_HIST-PROD'[txtOrdNo] ) )
    ),
    0
)

View solution in original post

2 REPLIES 2
AlexisOlson
Super User
Super User

Is this what you mean?

AVG Weekly Production Last 20 Wks =
ROUND (
    AVERAGEX (
        FILTER ( VALUES ( 'DimDates'[weekIndex] ), 'DimDates'[weekIndex] >= -20 ),
        CALCULATE ( COUNT ( 'Production_Stock_OrderLines_HIST-PROD'[txtOrdNo] ) )
    ),
    0
)

Thank You very much for the help.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Top Kudoed Authors