Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hello Everyone,
I have this tableau calculation where [Include in MPR Para] is a Tableau parameter and INCLUDE_IN_MPR is a column.
if [Include in MPR Para] = 'Included in MBO' and ([INCLUDE_IN_MPR]) = TRUE then TRUE
elseif [Include in MPR Para] = 'Excluded from MBO' and ([INCLUDE_IN_MPR]) in (FALSE/*,Null*/) then TRUE
elseif [Include in MPR Para] = 'All' and ([INCLUDE_IN_MPR]) in (True, False, Null) then TRUE
else FALSE end
I would like to replicate this in power bi.
I have created a disconnected table in Power BI with two values, 'Included in MBO' and 'All'. I tried to replicate the calculation with the below dax but it is not working.
Calc_Dax =
Please try the measure below:
Calc_Dax =
VAR _Sel =
SELECTEDVALUE ( 'Show Categories'[Value] )
VAR _IncludeFlag =
MAX ( APEX_INTL_MSF_FACT[INCLUDE_IN_MPR] )
RETURN
SWITCH (
TRUE (),
_Sel = "Included in MBO" && _IncludeFlag = TRUE (), 1,
_Sel = "Excluded from MBO" && _IncludeFlag <> TRUE (), 1,
_Sel = "All", 1,
0
)
Then apply this measure as a visual-level filter set to is 1 on your visuals.
The following replicates your tableau calculation.
Calc_DAX =
var _paraValue =
SELECTEDVALUE('Show Categories'[Value])
var _tableValue =
SELECTEDVALUE(apex_intl_msf_fact[Include_in_mpr])
var _result =
SWITCH(
TRUE(),
_paraValue = "Included in MBO" && _tableValue = TRUE(), TRUE(),
_paraValue = "Excluded from MBO" && _tableValue IN {FALSE()}, TRUE(),
_paraValue = "All" && (_tableValue IN {TRUE(), FALSE()} || ISBLANK(_tableValue)), TRUE(),
FALSE()
)
RETURN
_result
Proud to be a Super User! | |
Hi @kunjan_ashara
Try this:
Calc_Dax =
VAR Sel =
SELECTEDVALUE ( 'Show Categories'[Value], "All" )
VAR IncludeFlag =
MAX ( APEX_INTL_MSF_FACT[INCLUDE_IN_MPR] )
RETURN
SWITCH (
TRUE(),
-- Included in MBO
Sel = "Included in MBO"
&& IncludeFlag = TRUE(), 1,
-- Excluded from MBO
Sel = "Excluded from MBO"
&& ( IncludeFlag = FALSE() || ISBLANK ( IncludeFlag ) ), 1,
-- All
Sel = "All", 1,
0
)
Once you've added the measure to a slicer, change the visual level filter to 'is 1' in the right hand filter pane as shown in the screenshot
--------------------------------
I hope this helps, please give kudos and mark as solved if it does!
Connect with me on LinkedIn.
Subscribe to my YouTube channel for Fabric/Power Platform related content!
Is INCLUDE_IN_MPR a logical (TRUE/FALSE) column or a text column containing the word "TRUE"? If it is a logical type, the values should appear italicized in Data view, and the comparison should use TRUE() rather than "TRUE".
Also, the result of MAX(APEX_INTL_MSF_FACT[INCLUDE_IN_MPR]) can change depending on where the measure is being evaluated. In a visual, each row can have its own filters (for example a specific customer, product, or month), and the measure is calculated only using the data visible for that row.
_Flag = --try this might help you
VAR sel = SELECTEDVALUE('Show Categories'[Value])
RETURN
SWITCH(
TRUE(),
sel = "Included in MBO" && SELECTEDVALUE(APEX_INTL_MSF_FACT[INCLUDE_IN_MPR]) = TRUE(), 1,
sel = "Excluded from MBO" &&
(SELECTEDVALUE(APEX_INTL_MSF_FACT[INCLUDE_IN_MPR]) = FALSE()
|| ISBLANK(SELECTEDVALUE(APEX_INTL_MSF_FACT[INCLUDE_IN_MPR]))), 1,
sel = "All", 1,
0
)
Check out the April 2026 Power BI update to learn about new features.
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.
| User | Count |
|---|---|
| 42 | |
| 37 | |
| 34 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 65 | |
| 62 | |
| 31 | |
| 26 | |
| 25 |