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 September 15. Request your voucher.

Reply
Anonymous
Not applicable

Adding 2 rows in a dataset

My input dataset is as follows:

Cash

20

 

CashX0.90
Interest2.6
Loan100

 

When I'm reporting on the above data, Cash column must be calculated as value(Cash+CashX).

I'm trying to use a measure to do this, but I cant add botht he numbers.

 

Any help is greatly appreciated.

 

ara

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , Create a new column

 

New group = switch( True(),[column] in {"Cash","CashX"},"Cash",

[column])

or try binning/

SEGMENTATION

https://radacad.com/grouping-and-binning-step-towards-better-data-visualization

https://www.daxpatterns.com/dynamic-segmentation/
https://www.daxpatterns.com/static-segmentation/
https://www.poweredsolutions.co/2020/01/11/dax-vs-power-query-static-segmentation-in-power-bi-dax-power-query/

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Hi,

Write this calculated column formula and rename the column to Revised text

=if(ISNUMBER(SEARCH("Cash",Data[Text],1,BLANK())),"Cash",Data[Text])

To your visual, drag this revised text column and write this meaure

Total = SUM(Data[Amount])

Hope this helps.

Untitled.png

 


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

View solution in original post

7 REPLIES 7
Ashish_Mathur
Super User
Super User

Hi,

Try this measure

=calculate(sum(data[amount]),data[text]="Cash"||data[text]="Cashx")

Hope this helps.


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

Hi @Ashish_Mathur , every data row text gets the added value.

 

I do not understand your comment at all.


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

Sorry @Ashish_Mathur , I should have been more specific.

After adding the formula you had mentioned, all the rows get the sum of Cash and CashX

 

 

Cash20.90
CashX20.90
Interest20.90
Loan 20.90

 

Hope this makes sense.

Hi,

Write this calculated column formula and rename the column to Revised text

=if(ISNUMBER(SEARCH("Cash",Data[Text],1,BLANK())),"Cash",Data[Text])

To your visual, drag this revised text column and write this meaure

Total = SUM(Data[Amount])

Hope this helps.

Untitled.png

 


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

@Anonymous , Create a new column

 

New group = switch( True(),[column] in {"Cash","CashX"},"Cash",

[column])

or try binning/

SEGMENTATION

https://radacad.com/grouping-and-binning-step-towards-better-data-visualization

https://www.daxpatterns.com/dynamic-segmentation/
https://www.daxpatterns.com/static-segmentation/
https://www.poweredsolutions.co/2020/01/11/dax-vs-power-query-static-segmentation-in-power-bi-dax-power-query/

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks @amitchandak 

 

Using the switch statement, I now have 2 Cash rows, how do Iadd the values of Cash and CashX?

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 Kudoed Authors