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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
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.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.