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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Steve123
Frequent Visitor

Use measure in Iterator

Aplogies if this looks like a re-post, I initially accidentally put in under "Community".

 

Relatively new to Power BI and trying to do things that are easy in Excel (guessing I'm not the only one...)

 

I have a table of items a company sells with item dimensions.

 

I'm looking for how many items will fit in a tote (storage box), so that we can best figure out what size tote to use.

 

I have created a measure called Available Volume, based on height, width, length and percentage fill and have these values on sliders, so I can show available volume as a value:

 

Steve123_0-1668425568464.png

 

 

 

I can iterate through all items if I hardcode the tote size into the DAX measure:

 

Items per Tote =
SUMX(
    'Week 36',
    ROUNDDOWN(
        DIVIDE(
            40,
            'Week 36'[Item Volume]
       ),
       0
    )
)
 
Giving:
Steve123_1-1668425568465.png

 

 

Yet referencing the Volume of Tote Meause in the iterator blanks out all records in the visual:
Items per Tote =
SUMX(
    'Week 36',
    ROUNDDOWN(
        DIVIDE(
            [Available Volume],
            'Week 36'[Item Volume]
       ),
       0
    )
)
 
Steve123_2-1668425568316.png

 

 

 So, how do I reference Available Volume in that iterator? Is my problem because it isn't related to my table?
4 REPLIES 4
FreemanZ
Super User
Super User

try this:

 

Items per Tote =
VAR AvailableVolume =  [Available Volume]
RETURN
    SUMX(
        'Week 36',
         ROUNDDOWN(
              DIVIDE(
                  AvailableVolume,
                  'Week 36'[Item Volume]
              ),
          0
        )
     )

Thanks for the response. 

However, I get the same problem, with it returning blanks

 

For info, this works, but is still hardcoding it:

Items per Tote =
VAR AvailableVolume = 40
RETURN
    SUMX(
        'Week 36',
        ROUNDDOWN(
            DIVIDE(
                AvailableVolume,
                'Week 36'[Item Volume]
            ),
            0
        )
    )

May i see your definition of the measure [Available Volume]?

definition here:
 
Available Volume =
([Tote Length Value] * [Tote Height Value] * [Tote Width Value] * ([Percent Fill Value]/100))/1000000
 
and each of the values are Parameters.
 
There is no relationship between Available Volume and my 'Week 36' table.
 
Am I defining this wrong?
Basically, I'm trying to migrate something we've done in Excel over to Power BI and having some great success and looking at creating templates, but I'm wondering whether this is the right way to do particular thing.

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 MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.