Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Help with DAX formula into loop

Hello all, I have a question about my power query DAX formula. Below is my SWITCH and I want to put this in a loop. I want to constantly increase my loop by 2.5 because I have a lot of different va...
  • Jihwan_Kim's avatar
    5 years ago

    Hi, Anonymous 

    I am not sure if I understood your question correctly, but I suggest having a grouping table like below.

    Please check the below picture and the sample pbix file's link down below.

    I tried to create a sample pbix file based on the explanation. And the below type of grouping table is easy to create in excel and it can be imported into Power BI easily.

     

     

    Qty Total by Group =
    SUMX (
    FILTER (
    VALUES ( Sales[Date] ),
    COUNTROWS (
    FILTER (
    'Grouping',
    [Qty Total] > 'Grouping'[Min]
    && [Qty Total] <= 'Grouping'[Max]
    )
    ) > 0
    ),
    [Qty Total]
    )
     
     
     

    Hi, My name is Jihwan Kim.


    If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


    Linkedin: linkedin.com/in/jihwankim1975/

    Twitter: twitter.com/Jihwan_JHKIM