Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
I'm a relatively new PBI user for context. I'm trying to ultimately create a measure that is equal to 1 for "include" and 0 for "exclude" that I can add as a filter to my page so that only certain rows are included in my visuals.
The criteria for "include" are as follows:
a row should be "included" if...
Stts Cde is closed, and Dev Period <= some parameter that the user defines (2 conditions)
OR
Stts Cde is open, and Dev Period = some parameter that the user defines (2 conditions)
I was trying a calculated column, but I'm realizing that this does not work with the parameter. However, I cannot use a measure either because I need it evaluated by row. Does anyone have any tips?
This is the DAX for the calculated column that I have so far:
Solved! Go to Solution.
Hi @Anonymous
You can transform it to measure
Calc_Filter =
VAR a =
COUNTROWS (
FILTER (
Loss_Monitoring_Tool_Full_Data,
OR (
[Stts Cde] = "closed"
&& Loss_Monitoring_Tool_Full_Data[Dev Period] <= [PARAMETER],
Loss_Monitoring_Tool_Full_Data[Stts Cde] = "open"
&& Loss_Monitoring_Tool_Full_Data[Dev Period] = [PARAMETER]
)
)
)
RETURN
IF ( a > 0, 1, 0 )
Then put the measure to the visual filter.
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
You can transform it to measure
Calc_Filter =
VAR a =
COUNTROWS (
FILTER (
Loss_Monitoring_Tool_Full_Data,
OR (
[Stts Cde] = "closed"
&& Loss_Monitoring_Tool_Full_Data[Dev Period] <= [PARAMETER],
Loss_Monitoring_Tool_Full_Data[Stts Cde] = "open"
&& Loss_Monitoring_Tool_Full_Data[Dev Period] = [PARAMETER]
)
)
)
RETURN
IF ( a > 0, 1, 0 )
Then put the measure to the visual filter.
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you that worked!
Stts Cde is a column that is either "open" or "closed"
Dev Period is an integer column with values 0 through 65
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 35 | |
| 34 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 136 | |
| 102 | |
| 68 | |
| 66 | |
| 58 |