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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Mokegubshook
Helper I
Helper I

Compare number with target incorrect

Hi guys,

I have data like in the picture, My problem is I want to compare number of file delivery and Target in everyday. I have many file and each file have the target. My problem is I want number of file delivery not more then target (If it more than target set it as target) like in Dax picture. Does it have anyway to done this?

 

By the way I want measure to return like column K for further calculation. 

My data looklike: 

Mokegubshook_5-1745514642685.png

 

Dax

Mokegubshook_1-1745513078391.png

 

Mokegubshook_3-1745513351118.png

In table I show, the raw data is correct base on condition from dax I provide. But total is wrong (The red box), It should sum with Var D condition but looklike it sum with Var A.

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.

expected result measure: =
SUMX (
    VALUES ( dim_table_name[column_name_in_matrix_visual] ),
    IF ( [CNT_FILE_ID] > [Target], [Target], [CNT_FILE_ID] )
)

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.


Click here to visit my LinkedIn page

Click here to schedule 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.

expected result measure: =
SUMX (
    VALUES ( dim_table_name[column_name_in_matrix_visual] ),
    IF ( [CNT_FILE_ID] > [Target], [Target], [CNT_FILE_ID] )
)

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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Thank you so much, It working!

lbendlin
Super User
Super User

1. Remember that MIN() and  MAX() can take two parameters.  So MIN([Value],1)  will cap the result at 1 even if [Value] is higher.

2. If you want the totals to work you need to "think like the grand total".  Materialize the results for each day, then do a SUMX over that.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.