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

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/
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
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.