Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

See when key Fabric features will launch and what’s already live, all in one place and always up to date. Explore the new Fabric roadmap

Reply
AmiraBedh
Super User
Super User

Create a calculated table with an input column and calculated column

I want to create a table in Power BI like below :

 

Product Year  Count

A           2020 100

B           2021  569

C           2021    99

 

The product is an input column which means I provide the name in the creation of the calculated table.

The Year is the group by column and the count is the a measure : counting the rows of the product A by Year


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @AmiraBedh ,

 

You could use SUMMARIZE() function.

https://docs.microsoft.com/en-us/dax/summarize-function-dax 

Since the product is an input column, you will need to filter the table for each product before summarize it. Ie create multiple summarized table based on products then union the summarized tables.

For example:

new_table = 
var product_a = SUMMARIZE(FILTER(Table,Conditon1),[Year]"product","A",COUNT([column]))
var product_b = SUMMARIZE(FILTER(Table,Conditon2),[Year]"product","B",COUNT([column]))
return
union(product_a,product_b)

If I misunderstood your meaning, please share some sample data and expected result.

 

Best Regards,

Jay

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @AmiraBedh ,

 

You could use SUMMARIZE() function.

https://docs.microsoft.com/en-us/dax/summarize-function-dax 

Since the product is an input column, you will need to filter the table for each product before summarize it. Ie create multiple summarized table based on products then union the summarized tables.

For example:

new_table = 
var product_a = SUMMARIZE(FILTER(Table,Conditon1),[Year]"product","A",COUNT([column]))
var product_b = SUMMARIZE(FILTER(Table,Conditon2),[Year]"product","B",COUNT([column]))
return
union(product_a,product_b)

If I misunderstood your meaning, please share some sample data and expected result.

 

Best Regards,

Jay

amitchandak
Super User
Super User

@AmiraBedh , Last two are easy, they can be driven using group by power query or summarize of DAX.

 

How do you want calculate the product, that you need to tell to suggest solutions

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

Check out the May 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

Find out what's new and trending in the Fabric community.