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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
nospang
Frequent Visitor

Matrix returns all combinations

Hi all,

 

I want to display value 'X' for a means to indicate the current month (will serve as a today line). In the screenshot the yellow part should contain the value 'X'.  The names that are used are coming from the dimensions. 

nospang_1-1681323124528.png

 

 

However when creating measure below, the matrix return all possible combinations:

nospang_2-1681323143573.png

 

 

nospang_3-1681323206525.png

 How do I only display the relevant rows?

 

 

For further reference, screenshots of the model and tables

nospang_5-1681323317395.png

The bridge table links all the tables to each other

nospang_6-1681323376869.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @nospang ,

 

I suggest you to try code as below to create a measure.

today line =
VAR _CurrentMonth =
    DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 )
VAR _CheckIfCurrentMonth =
    MIN ( 'Calendar'[Date] ) = _CurrentMonth
VAR _Result =
    SWITCH ( TRUE (), _CheckIfCurrentMonth, "X", BLANK () )
VAR _Lev2List =
    CALCULATETABLE (
        VALUES ( bridge[Lvl2ID] ),
        FILTER ( ALL ( bridge ), bridge[Lvl1ID] = MAX ( 'Level 1'[ID] ) )
    )
RETURN
    IF ( MAX ( 'Level 2'[ID] ) IN _Lev2List, _Result )

Result is as below.

vrzhoumsft_0-1681461809446.png

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @nospang ,

 

I suggest you to try code as below to create a measure.

today line =
VAR _CurrentMonth =
    DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 )
VAR _CheckIfCurrentMonth =
    MIN ( 'Calendar'[Date] ) = _CurrentMonth
VAR _Result =
    SWITCH ( TRUE (), _CheckIfCurrentMonth, "X", BLANK () )
VAR _Lev2List =
    CALCULATETABLE (
        VALUES ( bridge[Lvl2ID] ),
        FILTER ( ALL ( bridge ), bridge[Lvl1ID] = MAX ( 'Level 1'[ID] ) )
    )
RETURN
    IF ( MAX ( 'Level 2'[ID] ) IN _Lev2List, _Result )

Result is as below.

vrzhoumsft_0-1681461809446.png

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.