Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hello,
I have a table like
AREA | VENDOR | PROD |
1 | 1 | A |
1 | 2 | B |
1 | 3 | A |
1 | 4 | A |
2 | 5 | A |
2 | 6 | B |
2 | 7 | B |
2 | 8 | C |
3 | 9 | A |
and i want use only measures to calculate the vendors by area
i.e
My required table matrix is like
AREA | A | B | C |
1 | 3 | 1 | 0 |
2 | 1 | 2 | 1 |
3 | 1 | 0 | 0 |
and then i want the max vendor name should there
i.e
My required table :
AREA | A | B | C |
1 | A | ||
2 | B | ||
3 | A |
I do not want to use calculated columns
Is there any way to do so with measure only
Thanks & Regards...
Solved! Go to Solution.
Hello @BIswajit_Das
For your question, I have created the following table
You can use the settings below to get the matrix style you want
Use the following measure to get the max vendor
Measure =
var _table=SUMMARIZE(ALL('Table'),'Table'[Area],'Table'[prod],"count",COUNT('Table'[vendor]))
var _max= MAXX(FILTER(_table,[Area] in VALUES('Table'[Area])),[count])
return IF(COUNT('Table'[vendor])=_max,MAX('Table'[prod]),BLANK())
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @BIswajit_Das
For your question, I have created the following table
You can use the settings below to get the matrix style you want
Use the following measure to get the max vendor
Measure =
var _table=SUMMARIZE(ALL('Table'),'Table'[Area],'Table'[prod],"count",COUNT('Table'[vendor]))
var _max= MAXX(FILTER(_table,[Area] in VALUES('Table'[Area])),[count])
return IF(COUNT('Table'[vendor])=_max,MAX('Table'[prod]),BLANK())
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Here's a step-by-step guide:
Count of Vendors by Area:
Create measures to count the vendors for each area. Assuming your table is named "YourTable," create the following measures:
These measures count the number of vendors for each product category (A, B, C) within each area.
Create Matrix Table:
Now, you can create a matrix table with the AREA on rows and the product categories (A, B, C) on columns. Place the respective measures in the values section of the matrix.
Max Vendor Name:
To get the maximum vendor name for each area, create the following measure:
This measure uses the SWITCH function to determine which product category has the maximum count for each area.
Now, you can add the MaxVendor_Area measure to your matrix table. It will display the maximum vendor name for each area.
Your final matrix table should look like the one you described, with counts for each product category and the corresponding maximum vendor name for each area. Remember to replace "YourTable" with the actual name of your table in Power BI.
In case there is still a problem, please feel free and explain your issue in detail and share sample file, It will be my pleasure to assist you in any way I can.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
92 | |
83 | |
71 | |
49 |
User | Count |
---|---|
143 | |
120 | |
110 | |
59 | |
57 |