Forum Discussion

Jumper's avatar
Jumper
Helper I
3 years ago
Solved

Filtered calculation range - improving the DAX

Hi all

 

I just created a quick measure but the DAX appears very cumbersome.  I have very litle experience with DAX, so i'm hoping for some help to refine the formula.

 

I got as far adding up to 9 with the quick measure, but when I saw the formula I realised it will be a bit silly counting out all numbers up to the current max (which is around 1500).

 

I basically need three ranges:

- minimum to 60 

- 60 to 100

- 100 to max

 

 

Any suggestions to improve my DAX?

  • Hi Jumper ,

     

    You could write something like this:

    WIP value 0 t0 60 =
    CALCULATE(SUM(fact service WIP daily snapshot[WIP at Sell]), 
    fact service WIP daily snapshot[DaysNoLabour] >=0  &&  fact service WIP daily snapshot[DaysNoLabour] <=60)

     

    Hope this helps!

    Accept this answer as a solution if it solves your query. Kudos are always appreciated!

     

    Thanks!

     

2 Replies

  • Tanushree_Kapse's avatar
    Tanushree_Kapse
    Impactful Individual

    Hi Jumper ,

     

    You could write something like this:

    WIP value 0 t0 60 =
    CALCULATE(SUM(fact service WIP daily snapshot[WIP at Sell]), 
    fact service WIP daily snapshot[DaysNoLabour] >=0  &&  fact service WIP daily snapshot[DaysNoLabour] <=60)

     

    Hope this helps!

    Accept this answer as a solution if it solves your query. Kudos are always appreciated!

     

    Thanks!