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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
tktmastr
Helper I
Helper I

Need help with a custom measure working on total but not rows

Hi all,

 

I'm trying to create a table with a date slider that combined Pledge and Donation data for an organization.

 

Sample Data Here: https://drive.google.com/drive/folders/1OwpTUt6DI4Wyx-AsRyawL5NyNkFV1cM7?usp=drive_link

 

Multiple Donations can be made for one pledge, and customers can have different campaigns they're pledging to.

 

I'm having trouble with my "Amount Given" measure. It seems to give the correct total but not showing any data on the specific rows.

tktmastr_0-1772827604609.png

 

Both ChatGPT and Gemini keep sending me around in circles and I've spent hours trying different things. Help!

 

Thanks so much!

 

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

There is a problem with the data.  Customer ID 45875514 is assigned to two different customers.  Correct this anomaly.  After that, create a Many to One and single direction relationship from the CustomerID column of the individual fact tables to the Customers table.  In the 3rd visual of the table, remove CustomerID, First name and Last name.  Drag these columns from the Customers table instead.  I have also revised the amount given measure.  Perform these changes inthe attached file.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
tktmastr
Helper I
Helper I

Thanks @Ashish_Mathur , that worked perfectly and I learned a couple of new things!

@hnguy71 I tried the other approach first but appreciate your response!

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
hnguy71
Super User
Super User

Hi @tktmastr 

 

Your model is a bit incorrect / inconsistent.

hnguy71_0-1772841108572.png


You have a customer with two different names. Ideally each customer should be unique with their own names. Additionally, I would create an additional dimension as a master dimension to build a relationship with the pledges and donations together.

 

 However, with your current model, the following would fix your issue:

Amount Given = 
VAR SelectedDate = MAX('Date'[Date])
VAR _Customer = SELECTEDVALUE(Pledges[CustomerId])
VAR _Campaign = SELECTEDVALUE(Pledges[FullCampaignName])

RETURN

CALCULATE(
    SUM(Donations[Amount]), 
    Donations[CustomerId] = _Customer, 
    Donations[FullCampaignName] = _Campaign,
    ALL(Pledges)
)


However, since the attributes aren't coming from the correct dimension, you'll get a missing total with this measure, in this case, to fix that you'll have to create a secondary measure to total it by row context:

Amount Given Total = SUMX(Pledges, [Amount Given])


Which would give you the following output:

hnguy71_1-1772841334540.png

 



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
Ashish_Mathur
Super User
Super User

Hi,

There is a problem with the data.  Customer ID 45875514 is assigned to two different customers.  Correct this anomaly.  After that, create a Many to One and single direction relationship from the CustomerID column of the individual fact tables to the Customers table.  In the 3rd visual of the table, remove CustomerID, First name and Last name.  Drag these columns from the Customers table instead.  I have also revised the amount given measure.  Perform these changes inthe attached file.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

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