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
Migsmix
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
selimovd
Super User
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:

selimovd_0-1619110442426.png

 

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

selimovd_1-1619110531205.png

 

This should give you the result you want:

selimovd_2-1619110579978.png

 

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
 

 

 

View solution in original post

1 REPLY 1
selimovd
Super User
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:

selimovd_0-1619110442426.png

 

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

selimovd_1-1619110531205.png

 

This should give you the result you want:

selimovd_2-1619110579978.png

 

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
 

 

 

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!

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.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.