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

How to create a Column Series for a Table Visual

Hi,

 

I have a visual that I want to add an additional series to.  Currently, my visual is plotting three Created Measures on the table's Column values.  The column 'Successful Intervention' is a Shared Axis and acts to break these created measures up by 'Yes' or 'No'.  I'd like to add a third series that would be a total of the Yes and No values:

 

Here is a photo of my visual currently:

Capture.PNG

Capture2.PNG

 

For reference, here are the three Created Measures in DAX:

1) 7 Day Readmission Rate = SUM ( 'Post Call to Home Append'[7 Day Readmit flag] ) / SUM ( 'Post Call to Home Append'[Easy Count] )
 
2) 14 Day Readmission Rate = SUM ( 'Post Call to Home Append'[14 Day Readmit flag] ) / SUM ( 'Post Call to Home Append'[Easy Count] )
 
3) 30 Day Readmission Rate = SUM ( 'Post Call to Home Append'[30 Day Readmit flag] ) / SUM ( 'Post Call to Home Append'[Easy Count] )
 
Is there an easy way to accomplish this?  Thank you.
1 ACCEPTED SOLUTION
v-janeyg-msft
Community Support
Community Support

Hi, @AW1976NOVA 

 

You need to create a new table with a single column including yes, no and total. Then use the new column in visual and modify the three measures. like this:

30 Day Readmission Rate =
IF (
    SELECTEDVALUE ( 'Table (2)'[Column1] ) <> "Total",
    CALCULATE (
        SUM ( 'Table'[30 DAY] ) / SUM ( 'Table'[EASY COUNT] ),
        FILTER (
            ALL ( 'Table' ),
            [Successful Readadmission] = SELECTEDVALUE ( 'Table (2)'[Column1] )
        )
    ),
    CALCULATE (
        SUM ( 'Table'[30 DAY] ) / SUM ( 'Table'[EASY COUNT] ),
        FILTER ( ALL ( 'Table' ), [Successful Readadmission] = "Yes" )
    )
        + CALCULATE (
            SUM ( 'Table'[30 DAY] ) / SUM ( 'Table'[EASY COUNT] ),
            FILTER ( ALL ( 'Table' ), [Successful Readadmission] = "No" )
        )
)

v-janeyg-msft_0-1621842531860.png

If you still have problems, please feel free to ask me.

 

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-janeyg-msft
Community Support
Community Support

Hi, @AW1976NOVA 

 

You need to create a new table with a single column including yes, no and total. Then use the new column in visual and modify the three measures. like this:

30 Day Readmission Rate =
IF (
    SELECTEDVALUE ( 'Table (2)'[Column1] ) <> "Total",
    CALCULATE (
        SUM ( 'Table'[30 DAY] ) / SUM ( 'Table'[EASY COUNT] ),
        FILTER (
            ALL ( 'Table' ),
            [Successful Readadmission] = SELECTEDVALUE ( 'Table (2)'[Column1] )
        )
    ),
    CALCULATE (
        SUM ( 'Table'[30 DAY] ) / SUM ( 'Table'[EASY COUNT] ),
        FILTER ( ALL ( 'Table' ), [Successful Readadmission] = "Yes" )
    )
        + CALCULATE (
            SUM ( 'Table'[30 DAY] ) / SUM ( 'Table'[EASY COUNT] ),
            FILTER ( ALL ( 'Table' ), [Successful Readadmission] = "No" )
        )
)

v-janeyg-msft_0-1621842531860.png

If you still have problems, please feel free to ask me.

 

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Greg_Deckler
Super User
Super User

@AW1976NOVA So if  you had a table that had your three values for the axis, Yes, No, Total then you could write your measures to basically be "get the max of your disconnected axis table". Calculate your measures filtering by that value. For the Total, you would just do both calculations and add them together. Could be more specific if you posted sample data.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Here is a sample of data from the table:

Capture3.PNG

I think the issue for me is that the Successful Readmission column only populates with Yes or No.  I'm struggling to understand how to work in the third value of 'Total'.  Would I have to add a new column and then use this column as the shared axis?  

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.