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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors