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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors