cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jenelrosales Regular Visitor
Regular Visitor

Consolidate Measures in one Table

Hello. I have several measures for my data in Power BI that goes like this:

Subject A:
Measure 1: average score for 3 months
Measure 2: average score for 6 months
Measure 3: average score for 1 year

Subjects B and C have the same measures.

Can I create a table/matrix where there will be columns:
Average score for 3 months
Average score for 6 months
Average score for 1 year

And my rows will be the subjects?

Thank you in advance.
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Consolidate Measures in one Table

Hi @jenelrosales,

 

I'd like to suggest you to union your tables and keep their table name.

Combine =
UNION (
    ADDCOLUMNS ( 'Subject A', "Table Name", "Subject A" ),
    ADDCOLUMNS ( 'Subject B', "Table Name", "Subject B" ),
    ADDCOLUMNS ( 'Subject C', "Table Name", "Subject C" )
)

Then write measure with condition to check their own table names.

meaure =
VAR currDate =
    MAX ( Combine[Date] )
RETURN
    CALCULATE (
        AVERAGE ( Combine[Amount] ),
        FILTER ( ALLSELECTED ( Combine ), 'date range filter formula' ),
        VALUES ( Combine[Table Name] )
    )

Please use your date range filter formula to replace bold part.

 

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |
1 REPLY 1
Community Support Team
Community Support Team

Re: Consolidate Measures in one Table

Hi @jenelrosales,

 

I'd like to suggest you to union your tables and keep their table name.

Combine =
UNION (
    ADDCOLUMNS ( 'Subject A', "Table Name", "Subject A" ),
    ADDCOLUMNS ( 'Subject B', "Table Name", "Subject B" ),
    ADDCOLUMNS ( 'Subject C', "Table Name", "Subject C" )
)

Then write measure with condition to check their own table names.

meaure =
VAR currDate =
    MAX ( Combine[Date] )
RETURN
    CALCULATE (
        AVERAGE ( Combine[Amount] ),
        FILTER ( ALLSELECTED ( Combine ), 'date range filter formula' ),
        VALUES ( Combine[Table Name] )
    )

Please use your date range filter formula to replace bold part.

 

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |

Helpful resources

Announcements
Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

Top Ideas
Users Online
Currently online: 262 members 2,931 guests
Please welcome our newest community members: