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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Syndicate_Admin
Administrator
Administrator

SUMX with visual filters

Good morning community, I write because I have a problem that I have been trying to solve for some time.

I have a table with some records of failures, which have start date and end date, I made a measurement to calculate the duration of the failure. The important thing about this measure is that if I select a specific month and the failure has as its starting date a day corresponding to the month prior to the selected one, I should take as the starting date for the calculation of the duration of the failure the first day of the month, this in order to be consistent with the filters that I am applying.

TiempoIncidenteMin =
WHERE iniTime = .MAX( MIN('Tickets Maximo Base'[creationdate]), MIN('Maximum Tickets Calendar'[Date]) + 1)
WHERE finTime = MIN( MIN('Tickets Maximo Base'[actualfinish]), .MAX('Maximum Tickets Calendar'[Date]))
WHERE diff = DATEDIFF(iniTime, finTime, MINUTE)
RETURN
diff
csmonroy_0-1685631727916.png

The problem is that when I add this measurement to a table visual, the fault durations are calculated correctly. However, in the totals it gives me a number that is not consistent, as if instead of adding what is in the column it is evaluated with the total of the other columns I am using. I would like to add all the durations of the failures in the total. I already tried using SUMX but this does not evaluate the month filters applied in the view.
Attached pbix in case anyone can help me.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Syndicate_Admin ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create a measure. 

Total_TiempoIncidenteMin = 
SUMX(VALUES('Tickets Maximo Base'[cinum]),[TiempoIncidenteMin])

(3) Then the result is as follows.

vtangjiemsft_0-1686626179169.png

vtangjiemsft_1-1686626191892.png

Best Regards,

Neeko Tang

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

2 REPLIES 2
Anonymous
Not applicable

Hi @Syndicate_Admin ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create a measure. 

Total_TiempoIncidenteMin = 
SUMX(VALUES('Tickets Maximo Base'[cinum]),[TiempoIncidenteMin])

(3) Then the result is as follows.

vtangjiemsft_0-1686626179169.png

vtangjiemsft_1-1686626191892.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

lbendlin
Super User
Super User

The important thing about this measure is that if I select a specific month and the failure has as its starting date a day corresponding to the month prior to the selected one, I should take as the starting date for the calculation of the duration of the failure the first day of the month, this in order to be consistent with the filters that I am applying.

I didn't get this part, can you please elaborate?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors