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
AW1976NOVA
Post Patron
Post Patron

Create a Measure: Sum totals for created data ranges

Hi,

 

I have a table (Claimant Transactions) that houses transaction data.  One of the fields is (Total Paid).  These values range from $0 to $10,000,000.

 

I am trying to create a visualization table that breaks down these transactions in to ranges.  In order to create the ranges I built a table in Power BI using the 'Enter Data' function.  I called it (Bin Select).  I also added an Index column so I can sort it with ease.  See below:

 

A.PNG

 

In order to build the visualization, I created a table and made a New Measure.  I called the New Measure (Number of Total Customers).  See below:

 

Number of Total Customers =

        IF(HASONEVALUE('Bin Select'[Min Value Range]),

            COUNTROWS(FILTER('Claimant Transactions',

                        [Total Paid]>=VALUES('Bin Select'[Min Value Range]) &&

                        [Total Paid]<VALUES('Bin Select'[Max Value Range])

                            )

                    ),

            COUNTROWS('Claimant Transactions')

        )

 

With this, I now have a Visualization (Table) of the following:

 

B.PNG

 

My problem is:  I want to create another measure that will sum the (Total Paid) for each range.  I want to add this measure to my visualization and I can't seem to write it correctly.

 

Can you please help me write this formula (Measure)?  

 

 

Thank you!

Andrew

1 ACCEPTED SOLUTION

Hi @AW1976NOVA 

 

Try this

 

Total Paid =

            SUMX(FILTER('Claimant Transactions',

                        [Total Paid]>=MIN('Bin Select'[Min Value Range]) &&

                        [Total Paid]<MAX('Bin Select'[Max Value Range])

                            ),

            [Total Paid]

        )

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

5 REPLIES 5
AW1976NOVA
Post Patron
Post Patron

Thank you for the continued help but that didn't work either.  The syntax is correct and doesn't contain an error.  However, it came back with an error within the visualization:

 

D.PNG

 

I am not sure what the issue is.  Is the problem that there are multiple values of the same transaction amount?  How do I go about handleing that?   I also verified that the (Total Paid) field is a whole number in the (Claimant Transaction) table:

E.PNG

 

The New Measure in the Bin Select table is also set to whole number:

F.PNG

 

Pretty stumped here now.

Hi @AW1976NOVA 

 

Try this

 

Total Paid =

            SUMX(FILTER('Claimant Transactions',

                        [Total Paid]>=MIN('Bin Select'[Min Value Range]) &&

                        [Total Paid]<MAX('Bin Select'[Max Value Range])

                            ),

            [Total Paid]

        )

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



MFelix
Super User
Super User

Hi @AW1976NOVA ,

 

you need to use an aggregator measure should be something similar to this:

 

Total Paid =

            SUMX(FILTER('Claimant Transactions',

                        [Total Paid]>=VALUES('Bin Select'[Min Value Range]) &&

                        [Total Paid]<VALUES('Bin Select'[Max Value Range])

                            )

                    ),

            [Total Paid]

        )

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Thank you for the quick response, but I can't seem to fix the syntax.  Can you help me further?

 

C.PNG

Seems like one additional )

 

Total Paid =

            SUMX(FILTER('Claimant Transactions',

                        [Total Paid]>=VALUES('Bin Select'[Min Value Range]) &&

                        [Total Paid]<VALUES('Bin Select'[Max Value Range])

                            ),

            [Total Paid]

        )

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.