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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
JeevanHT
Regular Visitor

Using an interim measure as a filter to create new table

I am using an interm measure in Filter funtion which is not giving me desired result, tried using VAR as well but no luck.

 

Dataset: "Inventory" table has 3 Columns, PanelID (Unique ID for each row), ReachIndex(HIGH, Medium, LOW), Reach(reach for each panel)

JeevanHT_0-1679895660992.png

 

Requirement: Based on the user input, I must display 20% HIGH ReachIndex panels, 70% Medium ReachIndex panels and 10% LOW ReachIndex panels from inventory table in a new table called "Selection".

 

Example: if user input is 20, "Selection" table must display any 4 HIGH, 14 Medium and 2 LOW panels.

 

Implimentation : I have used what if parameter to take user input and calculated dax measures to calucalte number of panels to be displayed for each ReachIndexe types.

 

HighIndexPanels = ROUNDDOWN(Parameter[Parameter Value] * 0.20, 0)
MediumIndexPanels = ROUNDUP(Parameter[Parameter Value] * 0.7, 0)
LOWIndexPanels = Parameter[Parameter Value] - HighIndexPanels - MediumIndexPanels

 

calculated column "CoulmnIndexRank" to assign ranks to panels within each ReachIndex types.

 

ColumnIndexRank = RANKX(FILTER(
                'Inventory',
                'Inventory'[ReachIndex]=EARLIER('Inventory'[ReachIndex])
                ), Inventory[Reach])

JeevanHT_1-1679895875326.png

 

created "Selection" table with below DAX code (Will implement for all ReachIndex types once I get expected result for 'Medium' ReachIndex type. )

 

Selection =
var m = [MediumIndexPanels]
return
FILTER (
Inventory,
Inventory[ColumnIndexRank] <= m && Inventory[ReachIndex] = "Medium"
)

This is showing me just one panel for all user inputs. For example when I input 20 panels, Selection table is showing only one panel where as it is suppose to show 14 panels.

 

JeevanHT_2-1679895973245.png

@Datatouille @MartynRamsden @needhelp 

0 REPLIES 0

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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