cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors