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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
water-guy-5
Helper III
Helper III

How to get a data card to display the total sum of a measure

Hello,

I have a table that contains the "maximum limit" for a site, along with the result from a certain test. The Diff column is used to create a flag for when a site has a result that is greater than the limit.

The measures of the columns are:


Result=
AVERAGEX(
    KEEPFILTERS(VALUES('FactLabResults'[Analysis])),
    CALCULATE(AVERAGE('FactLabResults'[ResultTxt])
))
Limit = a set value in a table
Diff = a simple calculation that subtracts these two values

Flag

IF[Diff] > 0, 1, 0)


Here is a table that illustrates this.

waterguy5_1-1652802281181.png

 

I have successfully created a conditional format that highlights a site red when the difference > 0 aka flag = 1. This works on the row level, meaning when the table has the sites column included.

What I want is to be able to have a data card (pictured in the bottom right) that would display the total number of exceedences in this example. As of now, I believe that it is summarizing all of the values and since the total result is lower than the total limit for ALL sites, then it is displaying zero.

How do I fix this?

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @water-guy-5 ,

You can create a measure as below to get it and put this new measure onto your card visual.

Measure =
SUMX (
    GROUPBY ( 'FactLabResults', 'FactLabResults'[Code], 'FactLabResults'[Site] ),
    [Diff]
)

Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand

Dax for Power BI: Fixing Incorrect Measure Totals

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
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
v-yiruan-msft
Community Support
Community Support

Hi @water-guy-5 ,

You can create a measure as below to get it and put this new measure onto your card visual.

Measure =
SUMX (
    GROUPBY ( 'FactLabResults', 'FactLabResults'[Code], 'FactLabResults'[Site] ),
    [Diff]
)

Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand

Dax for Power BI: Fixing Incorrect Measure Totals

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
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

Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. Avoid posting screenshots of your source data if possible.

Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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