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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
AndreaBracco
Regular Visitor

Problems with row/filter context

Hi all,

I am quite new to Power BI and I have the following issue. I have the following visual, where the column "Check_Global" is actually a measure.

AndreaBracco_0-1740142666354.png

The measure is computed as follows.

 
Check_Global = if(or(
                               sumx('CHP Units','CHP Units'[Check_Hours])>0,
                               sumx('CHP Units','CHP Units'[Check_EE])>0
                                   ),
                             1,blank() )

My question is: why is not the total equal to the column sum? In this example, I aspected to get 12.
Basically, the Check_Global should tell me how many days have corrupted data.

I think it is related to row\filter context, but I am very confused about it...
And, as follows, I report another issue I think always related to row\filter context.
In the following matrix, the measure "CB" is showed by ID and Month.
AndreaBracco_3-1740143648431.png

As you can see, ID totals are corrected but month totals no!
Please not that this calculation is very complex, so the ID sum could be not equal to the monthly sum...however it is useful to have a graphical representation of the monthly data. Instead, the sum over all ID for each month should be the exact sum!

The measure is computed as follows.

AndreaBracco_2-1740143113226.png

 

 

I humbly ask your help!

Thanks

Andrea

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your semantic model looks like, but please try something like below whether it works.

Check_Global =
SUMX (
    VALUES ( calendar_table[date_column] ),
    CALCULATE (
        IF (
            OR (
                SUMX ( 'CHP Units', 'CHP Units'[Check_Hours] ) > 0,
                SUMX ( 'CHP Units', 'CHP Units'[Check_EE] ) > 0
            ),
            1,
            BLANK ()
        )
    )
)


Microsoft MVP



If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule a short Teams meeting to discuss your question



View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your semantic model looks like, but please try something like below whether it works.

Check_Global =
SUMX (
    VALUES ( calendar_table[date_column] ),
    CALCULATE (
        IF (
            OR (
                SUMX ( 'CHP Units', 'CHP Units'[Check_Hours] ) > 0,
                SUMX ( 'CHP Units', 'CHP Units'[Check_EE] ) > 0
            ),
            1,
            BLANK ()
        )
    )
)


Microsoft MVP



If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule a short Teams meeting to discuss your question



Hi, it worked perfectly. Thank you

quantumudit
Super User
Super User

Hello @AndreaBracco 

Could you please provide sample data that fully represents your issue or question in a usable format, rather than a screenshot? Ensure the dataset is anonymized and does not contain any sensitive or unrelated information.

 

Additionally, it would be very helpful if you could share the expected outcome based on the provided data - this can be in any format, including a screenshot. Having a clear reference for comparison will significantly improve the chances of getting the correct solution in the first response.

 

For best practices, you may find the following links useful:

 

Thanks,
Udit

🚀 Let's Connect: LinkedIn || YouTube || Medium || GitHub
Visit My Linktree: LinkTree

Proud to be a Super User

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.