Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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.
However when creating measure below, the matrix return all possible combinations:
How do I only display the relevant rows?
For further reference, screenshots of the model and tables
The bridge table links all the tables to each other
Solved! Go to Solution.
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.
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.
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.
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.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 50 | |
| 44 | |
| 41 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 69 | |
| 68 | |
| 32 | |
| 32 | |
| 32 |