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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
nareshr89
Helper II
Helper II

DAX Help

I have a column "Table[ML]" with values from 1 to 12 and the same values in Dimension table Table1[ML]

 

When i select a value ex 1 in Dimension table, the main table column needs to be sliced with values 1 and 2 data only. Need a dax to filter the visula to show specific number and the next number data only.

 

 

3 REPLIES 3
tamerj1
Super User
Super User

Hi @nareshr89 
Please create the following filter measure, Place it in the filter pane of the visual, select "is not blank" then apply the filter.

FilterMeasure =
VAR SelecedML =
    MAX ( 'Table1'[ML] )
RETURN
    COUNTROWS (
        CALCULATETABLE (
            'Table',
            ALL ( 'Table1' ),
            'Table'[ML]
                IN { SelecedML, SelecedML + 1 }
        )
    )
FreemanZ
Super User
Super User

hi @nareshr89 

 

try to feed the filter pane with a measure like:

FilterMeasure =
VAR _value = SELECTEDVALUE(DimTable[ML])
RETURN
IF(
   MAX(MainTable[ML]) IN {_value, _value+1},
   1, 0
)
 
choose 1 in the filter pane.
amitchandak
Super User
Super User

@nareshr89 , Option one they are joined

 

if(selectedvalues(Table1[ML]) =1, calculate(Sum(Table[Value]), filter(All(Table1), Table1[ML] in {1,2})), Sum(Table[Value]))

 

in case they are not joined

 

if(selectedvalues(Table1[ML]) =1, calculate(Sum(Table[Value]), filter((Table), Table[ML] in {1,2})), calculate(Sum(Table[Value]), filter( Table, Table[ML] in Values(Table1[ML]) ) ) )

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.