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
ChristoNindyo
Advocate I
Advocate I

Matrix with its own value when I expand to the next level

Hello,

 

I want to ask how do I calculate Stores below. I want it has its own value when I expand to the next level (the manager name)

ChristoNindyo_1-1706752419069.png

This is the measure I used :

AM_STORE_COUNT3 =
CALCULATE(
DISTINCTCOUNT(CUST_UNI[LEGAL_NAME]),
CUST_UNI[BANNER_NAME] = SELECTEDVALUE(IRI_STORE_COMBINED[BANNER_NAME]
))

 

Notes: LEGAL_NAME is the store name

 

Thank you !

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@ChristoNindyo ,  Your formula seem fine to me, you can use removefilters

AM_STORE_COUNT3 =
CALCULATE(
DISTINCTCOUNT(CUST_UNI[LEGAL_NAME]),
removefilters(CUST_UNI[BANNER_NAME])
))


or


AM_STORE_COUNT3 =
CALCULATE(
DISTINCTCOUNT(CUST_UNI[LEGAL_NAME]),
filter(allselected(CUST_UNI) , CUST_UNI[BANNER_NAME] = max(CUST_UNI[BANNER_NAME])
))

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

Ritaf1983
Super User
Super User

Hi @ChristoNindyo 
It seems that you are using disconnected tables...
if the tables are with relationships the measure  should be just :
DISTINCTCOUNT(CUST_UNI[LEGAL_NAME])


if not you can try something like :
if (CUST_UNI[BANNER_NAME] = max(IRI_STORE_COMBINED[BANNER_NAME],

DISTINCTCOUNT(CUST_UNI[LEGAL_NAME]),"")

for more detailed and accurate suggestion 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

2 REPLIES 2
Ritaf1983
Super User
Super User

Hi @ChristoNindyo 
It seems that you are using disconnected tables...
if the tables are with relationships the measure  should be just :
DISTINCTCOUNT(CUST_UNI[LEGAL_NAME])


if not you can try something like :
if (CUST_UNI[BANNER_NAME] = max(IRI_STORE_COMBINED[BANNER_NAME],

DISTINCTCOUNT(CUST_UNI[LEGAL_NAME]),"")

for more detailed and accurate suggestion 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
amitchandak
Super User
Super User

@ChristoNindyo ,  Your formula seem fine to me, you can use removefilters

AM_STORE_COUNT3 =
CALCULATE(
DISTINCTCOUNT(CUST_UNI[LEGAL_NAME]),
removefilters(CUST_UNI[BANNER_NAME])
))


or


AM_STORE_COUNT3 =
CALCULATE(
DISTINCTCOUNT(CUST_UNI[LEGAL_NAME]),
filter(allselected(CUST_UNI) , CUST_UNI[BANNER_NAME] = max(CUST_UNI[BANNER_NAME])
))

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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.

Jan NL Carousel

Fabric Community Update - January 2025

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