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

Group Measures by Year

Hello Friends,

I have 3 measures Toys Sales, Clothes Sales and Shoe Sales by Location and Year as below in a cross tab.

RajTechDev_0-1615064785793.png

I want to show the measures together by Year as below.

RajTechDev_1-1615064838896.png

This is Power BI desktop.

Regards

NB

 

 

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

e1.png

 

Measures:

Clothes Sales Measure = 
CALCULATE(
    SUM('Table'[Sales]),
    FILTER(
        'Table',
        [Category]="Clothes Sales"
    )
)
Shoes Sales Measure = 
CALCULATE(
    SUM('Table'[Sales]),
    FILTER(
        'Table',
        [Category]="Shoes Sales"
    )
)
Toys Sales Measure = 
CALCULATE(
    SUM('Table'[Sales]),
    FILTER(
        'Table',
        [Category]="Toys Sales"
    )
)

 

Result:

e2.png

 

If i misunderstand your thoughts, please show us some sample data and expected result with OneDrive for business. Do mask sensitive data before uploading. Thanks.

 

Best Regards

Allan

 

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

5 REPLIES 5
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

e1.png

 

Measures:

Clothes Sales Measure = 
CALCULATE(
    SUM('Table'[Sales]),
    FILTER(
        'Table',
        [Category]="Clothes Sales"
    )
)
Shoes Sales Measure = 
CALCULATE(
    SUM('Table'[Sales]),
    FILTER(
        'Table',
        [Category]="Shoes Sales"
    )
)
Toys Sales Measure = 
CALCULATE(
    SUM('Table'[Sales]),
    FILTER(
        'Table',
        [Category]="Toys Sales"
    )
)

 

Result:

e2.png

 

If i misunderstand your thoughts, please show us some sample data and expected result with OneDrive for business. Do mask sensitive data before uploading. Thanks.

 

Best Regards

Allan

 

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

Ashish_Mathur
Super User
Super User

Hi,

How is your Source data arranged?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

All the data is one flat table.I can arrange that into Fact and Dimensions if I need to.

Hi,

Share some data to work with.


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

You can do this is you write one measure "sales", and then use a column from your model for "category" and "year"



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

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.