Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello,
I would like to create a table with a different measure for each row, like the following table:
CATEGORY | AMOUNT |
Category 1 | Measure 1 |
Category 2 | Measure 2 |
Category 3 | Measure 3 |
Category 4 | Measure 4 |
Category 5 | Measure 5 |
Category 6 | Measure 6 |
Is this possible to do? If it is possible, how could he do it?
Thank you very much and best regards.
Solved! Go to Solution.
Hi,
With "If" statements? (if category = category 1; measure 1; if cat= cat 2.... etc)
Hi @Anonymous,
In addition, you should also be able to use SWITCH function in this scenario. The formula below is for your reference.
AMOUNT = IF ( HASONEVALUE ( 'Table1'[CATEGORY] ), SWITCH ( VALUES ( 'Table1'[CATEGORY] ), "Category 1", [measure1], "Category 2", [measure2], "Category 3", [measure3], "Category 4", [measure4], "Category 5", [measure5], "Category 6", [measure6], 0 ) )
Regards
Hi @Anonymous,
In addition, you should also be able to use SWITCH function in this scenario. The formula below is for your reference.
AMOUNT = IF ( HASONEVALUE ( 'Table1'[CATEGORY] ), SWITCH ( VALUES ( 'Table1'[CATEGORY] ), "Category 1", [measure1], "Category 2", [measure2], "Category 3", [measure3], "Category 4", [measure4], "Category 5", [measure5], "Category 6", [measure6], 0 ) )
Regards
Hi @v-ljerr-msft,
If I understand correctly, the amount formula you are doing is creating a column, but my question is how to create the table with the Category column.
Thank you and best regards.
Hi @Anonymous,
Where is the Category column from? Is it a column of one of your table in your mode?
If that is the case, you can firstly use the the formula below to create a measure.
Measure1 = IF ( HASONEVALUE ( 'CatagoryTable'[Catagory] ), SWITCH ( VALUES ( 'CatagoryTable'[Catagory] ), "Category 1", [measure1], "Category 2", [measure2], "Category 3", [measure3], "Category 4", [measure4], "Category 5", [measure5], "Category 6", [measure6], 0 ) )
Then you should be able to use the formula below to create the table with the Category column.
Table = SUMMARIZE ( 'CatagoryTable', 'CatagoryTable'[Catagory], "Amount", [Measure1] )
Regards
Thank you,
you REALLY helped me
When i am trying to create the table as you have mentioned I am getting below error. Please help...
"The function SUM cannot work with values of type String."
Can you please attach the sample PBI which I can refer this?
I am trying to create the table as in below post. Is that possible with the above code? Please guide me..
Hi,
With "If" statements? (if category = category 1; measure 1; if cat= cat 2.... etc)
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
56 | |
55 | |
54 | |
37 | |
29 |
User | Count |
---|---|
77 | |
62 | |
45 | |
40 | |
40 |