Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
Hi
I have a matrix and I want to bring in a sum of distinct location from an other table
i.e. I want to return that there is 5 cubes listed in a Location tables (in the colume called Column)
The line between the tables is Location UID in which Location UID is unique and contains the location type
I have a measure to count DISTINCT location but you can’t add a measure to a row in a Power BI matric, any easy work around
Solved! Go to Solution.
@Garbo62 ,
Create a Calculated Column:
Go to the Data view in Power BI.
Select the table where you want to add the calculated column.
Click on New Column and enter the following DAX formula to count the distinct locations:
DAX
DistinctLocationCount =
CALCULATE(
DISTINCTCOUNT(Location[Location UID]),
ALLEXCEPT(Location, Location[Location Type])
)
This formula calculates the distinct count of Location UID for each Location Type.
Use the Calculated Column in Your Matrix:
Go to the Report view.
Add a matrix visual to your report.
Drag the Location Type to the rows of the matrix.
Drag the DistinctLocationCount calculated column to the values of the matrix.
This way, you will have a matrix that shows the count of distinct locations for each location type.
Proud to be a Super User! |
|
Brillent Thanks works a treat.
@Garbo62 ,
Create a Calculated Column:
Go to the Data view in Power BI.
Select the table where you want to add the calculated column.
Click on New Column and enter the following DAX formula to count the distinct locations:
DAX
DistinctLocationCount =
CALCULATE(
DISTINCTCOUNT(Location[Location UID]),
ALLEXCEPT(Location, Location[Location Type])
)
This formula calculates the distinct count of Location UID for each Location Type.
Use the Calculated Column in Your Matrix:
Go to the Report view.
Add a matrix visual to your report.
Drag the Location Type to the rows of the matrix.
Drag the DistinctLocationCount calculated column to the values of the matrix.
This way, you will have a matrix that shows the count of distinct locations for each location type.
Proud to be a Super User! |
|
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
142 | |
79 | |
64 | |
52 | |
46 |
User | Count |
---|---|
213 | |
89 | |
77 | |
66 | |
60 |