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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
saud968
Memorable Member
Memorable Member

Calculated Column from Measure

I am using this Dax as a measure - 

S =
CALCULATE(
    COUNT('Colleague Events'[SEARCH_ID]),
    FILTER(
        'Colleague Events',
        'Colleague Events'[CAUSE2] IN {"didyoumeanAutomatic", "didyoumeanClick", "searchboxSubmit", "searchboxAsYouType", "omniboxSearch", "omniboxAnalytics", "omniboxFromLink", "omniboxField", "searchFromLink"}
    )
)

But when I use the same dax for the calculated column it is not giving the correct output. Please download the Excel files 

https://drive.google.com/file/d/1dGREcWSPPDGj8MBnQNAcqeKV_s1swcG5/view?usp=drivesdk - This one shows incorrect count when using the dax in calculated Column

 

https://docs.google.com/spreadsheets/d/14f-X4TZkshu0rgOi_Cn22y8C8l8chgXz/edit?usp=drivesdk&ouid=1093...



@Ahmedx @Fowmy @Ritaf1983 @amitchandak @Idrissshatila 
1 ACCEPTED SOLUTION

The "Colleague Name" is from another column. However, I was able to resolve the issue by separating the filter. 


IsDesiredCause =
    'Colleague Events'[CAUSE2] IN {"didyoumeanAutomatic", "didyoumeanClick", "searchboxSubmit",
                                   "searchboxAsYouType", "omniboxSearch", "omniboxAnalytics",
                                   "omniboxFromLink", "omniboxField", "searchFromLink"}
Colleague Searches =
CALCULATE (
        COUNT('Colleague Events'[SEARCH_ID]), ALLEXCEPT('Colleague Events', 'Colleague Events'[CAUSE2]), 'Colleague Events'[IsDesiredCause] = TRUE()
)
This gave the correct output

 

Best Regards

Saud Ansari

If this post helps, please Accept it as a Solution to help other members find it. I appreciate your Kudos!

View solution in original post

5 REPLIES 5
DataInsights
Super User
Super User

@saud968,

 

Try this calculated column. The ALL calculate modifier is necessary to clear the filter context, and then apply the desired filter.

 

S =
CALCULATE (
    COUNT ( 'Colleague Events'[SEARCH_ID] ),
    ALL ( 'Colleague Events' ),
    'Colleague Events'[CAUSE2]
        IN {
            "didyoumeanAutomatic",
            "didyoumeanClick",
            "searchboxSubmit",
            "searchboxAsYouType",
            "omniboxSearch",
            "omniboxAnalytics",
            "omniboxFromLink",
            "omniboxField",
            "searchFromLink"
        }
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




I tried unfortunately still getting the incorrect output

 

Anonymous
Not applicable

S =
CALCULATE (
    COUNT ( 'Colleague Events'[SEARCH_ID] ),
    FILTER (
        'Colleague Events',
        'Colleague Events'[Colleague Name]
            = EARLIER ( 'Colleague Events'[Colleague Name] )
            && 'Colleague Events'[CAUSE2]
            IN {
                "didyoumeanAutomatic",
                "didyoumeanClick",
                "searchboxSubmit",
                "searchboxAsYouType",
                "omniboxSearch",
                "omniboxAnalytics",
                "omniboxFromLink",
                "omniboxField",
                "searchFromLink"
            }
    )
)

If the following information cannot meet your requirement, can you provide some sample output you want?

 

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.

Also, please accept it as a solution for me. 

The "Colleague Name" is from another column. However, I was able to resolve the issue by separating the filter. 


IsDesiredCause =
    'Colleague Events'[CAUSE2] IN {"didyoumeanAutomatic", "didyoumeanClick", "searchboxSubmit",
                                   "searchboxAsYouType", "omniboxSearch", "omniboxAnalytics",
                                   "omniboxFromLink", "omniboxField", "searchFromLink"}
Colleague Searches =
CALCULATE (
        COUNT('Colleague Events'[SEARCH_ID]), ALLEXCEPT('Colleague Events', 'Colleague Events'[CAUSE2]), 'Colleague Events'[IsDesiredCause] = TRUE()
)
This gave the correct output

 

Best Regards

Saud Ansari

If this post helps, please Accept it as a Solution to help other members find it. I appreciate your Kudos!

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.