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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Create an indicator based on a parameter

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:

 

Calc_Filter =
    IF(Loss_Monitoring_Tool_Full_Data[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], 1, 0)
1 ACCEPTED SOLUTION
Anonymous
Not applicable

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.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

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.

Anonymous
Not applicable

Thank you that worked!

Anonymous
Not applicable

Stts Cde is a column that is either "open" or "closed"

 

Dev Period is an integer column with values 0 through 65

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.