cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Frequent Visitor

## Help with subtotal formula

Hi! i'm trying to replicate the file i'm uploading here https://we.tl/t-3aY9nitu88 in PBI

U can see in the file:

1. Raw Data

2. The table i would like to see in PBI

The mandatory thing is that i need to use subtotal formula and not just count() or sum().

Thanks!!!

1 ACCEPTED SOLUTION
Super User

Hey @Migsmix ,

let's say your table with the RAW DATA is called myTable. Then create 3 measures:

Subtotal (Count) = COUNTROWS(myTable)

Then for the SUM:

Subtotal (SUM) = SUM(myTable[Purchases])

And the frequency:

Frequency = [Subtotal (SUM)] / [Subtotal (Count)]

Create a matrix in Power BI, put the color to the columns all the 3 measures to the values:

Afterwards go to the format tab and under the "Values" section set the check box to "Show on rows":

This should give you the result you want:

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Super User

Hey @Migsmix ,

let's say your table with the RAW DATA is called myTable. Then create 3 measures:

Subtotal (Count) = COUNTROWS(myTable)

Then for the SUM:

Subtotal (SUM) = SUM(myTable[Purchases])

And the frequency:

Frequency = [Subtotal (SUM)] / [Subtotal (Count)]

Create a matrix in Power BI, put the color to the columns all the 3 measures to the values:

Afterwards go to the format tab and under the "Values" section set the check box to "Show on rows":

This should give you the result you want:

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors