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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
SophRow
Resolver II
Resolver II

calculate total - should be easy!

Hi,

 

I have data from a clinical trial that looks like this:

 

SophRow_0-1659314908057.png

The visualistion looks like this:

SophRow_1-1659314957928.png

As you can see it has autocalculated the total (107 events in the first example) - how do i create a measure to show this, so i can add to another visualisation for summary purposes, and also so i can sort the x axis by totals?

 

Thanks so much!

 

Soph

 

2 ACCEPTED SOLUTIONS
tamerj1
Super User
Super User

Hi @SophRow 
You need to create a measure that sums the counts
COUNTA ( TableName[Column1] ) + COUNTA ( TableName[Column2] ) + COUNTA ( TableName[Column3] ) ... etc..

View solution in original post

MahyarTF
Memorable Member
Memorable Member

Hi,

Use below dax measure :

_CntAll = count(Sheet51[Headache])+count(Sheet51[Syncope])+count(Sheet51[Falls])+count(Sheet51[Oedema])+count(Sheet51[Kalaemia])+count(Sheet51[Hyponatraemia])
Then use it in other visuals.
For the particular Column Chart, Put the created measure(I paste it before), in Tooltips, then sort the chart based on this measure :
MahyarTF_0-1659321455144.png

 

Mahyartf

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Your data is not well structued.  In the Query Editor, select the first 2 columns, right click and select "Unpivot Other columns".  Now create your visual and write this measure

Participants = distinctcount(Data[Participant])

Hope this helps.


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

Hi,

Use below dax measure :

_CntAll = count(Sheet51[Headache])+count(Sheet51[Syncope])+count(Sheet51[Falls])+count(Sheet51[Oedema])+count(Sheet51[Kalaemia])+count(Sheet51[Hyponatraemia])
Then use it in other visuals.
For the particular Column Chart, Put the created measure(I paste it before), in Tooltips, then sort the chart based on this measure :
MahyarTF_0-1659321455144.png

 

Mahyartf
tamerj1
Super User
Super User

Hi @SophRow 
You need to create a measure that sums the counts
COUNTA ( TableName[Column1] ) + COUNTA ( TableName[Column2] ) + COUNTA ( TableName[Column3] ) ... etc..

rodrigosan
Resolver III
Resolver III

Hello how are you?
I didn't understand your question correctly.
Here's the example I created to see if it helps.
https://5pwtcn-my.sharepoint.com/:f:/g/personal/rodrigosan_5pwtcn_onmicrosoft_com/Ekk2Pvc89A9CoffLPi...

 

Did I solve your problem?
Please mark as solution so others can find this solution.
https://www.linkedin.com/in/rodrigosanpbi/

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.