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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.