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'm trying to create a matrix that summaries sales for country and region within the country. Some countries have many regions (states in the USA, for example) and some countries have no regions. When I use the matrix to display the data I get the following:
Country1 <country sum>
Region1 <region within country 1 sum>
Region3 <region within country 1 sum>
Region3 <region within country 1 sum>
Country 2 <country2 sum>
<blank> <country2 sum>
Country 3...
I would like to remove null regions so the data looks like this:
Country1 <country sum>
Region1 <region within country 1 sum>
Region3 <region within country 1 sum>
Region3 <region within country 1 sum>
Country 2 <country2 sum>
Country 3...
Is this possible?
Solved! Go to Solution.
Please check out enclosed file and state clearly what your desired result is instead, as I still don't understand what your exact requiremetn is.
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Hi @Anonymous,
The @ImkeF's solution works. Please try it out. You also can try the new feature of the November release. Please refer to the snapshot below.
Best Regards,
Dale
Dale, would it be possible to not expand in the first place? The sub-category field is null.
Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials
Hm - not sure if I got the request right, but for my understanding a measure like this should work:
RaggedH1 = IF ( ISFILTERED ( DimRegion[Region] ) = FALSE () || MIN ( DimRegion[Region] ) <> ""; SUM ( 'Fact'[Amount] ); BLANK () )
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
@ImkeF: this didn't work, unfortunately. It creates a blank row. The user requires that the row not shown at all (only country level results shown when the region column is null).
Please check out enclosed file and state clearly what your desired result is instead, as I still don't understand what your exact requiremetn is.
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Hi Imke,
I had to reorganize my data to match your setup and once I did your solution worked. Thanks for your help!
Regards,
Mustafa
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
99 | |
69 | |
46 | |
39 | |
33 |
User | Count |
---|---|
163 | |
110 | |
61 | |
51 | |
40 |