The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi, Can somebody please help and explain why this doesn't return the right total values.
I originally have this matrix with flat values:
However, business does not want the negative value to be included in the totals, so I created this measure:
Solved! Go to Solution.
Hello
this would probably look like this:
Test again ?
SUMX (
SUMMARIZE (
'AUM Config',
'AUM Config'[IDR_BILLING_GROUP], - don't take this from the fact table
'YourDimTableName'[IDR Config SETTINGNA....], // take the field from the Dim table that you have used in the report
'YourDimTableName'[Adjusted MOD_Groupin....], // take the field from the Dim table that was used in the report
"@MKT", SUM ( 'AUM Config'[MKT_VALUE_USD] )
),
SI ( [@MKT] > 0, [@MKT], WHITE () )
)
Replace the red text with the model match fields.
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 @msantillan
check the granularity of the field "AUM Config'[IDR_BILLING_GROUP]"
In addition I'd suggest to replace it with a field from your dimension table instead. Just make sure that it is a finer grain that the field you drag into the visual.
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 But I need it to be filtered on a row basis level, can you please expound more on this?
Hi @msantillan
if you want it to be filtered on a row level, then the field "AUM Config'[IDR_BILLING_GROUP]" would have to have unique values. (Just the name suggests that it doesn't).
But it seems that I haven't read your question properly:
What exactly do you mean with: "business does not want the negative value to be included in the totals,"?
Could you please give samples (before and after) for the data you've provided?
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 If you could see the first picture, it has a negative value on the cash group. Once I made the summarized measure, it was gone on the second picture. But the total still shows the one with the negative value (same with the first picture).
Hi @msantillan
include both fields from the lowest granularity-level in your visual in the SUMMARIZE.
The totals still include the negative value, because the column-values are still summed up.
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
Can you please give an example where the column is also included in the Summarized measure @ImkeF ? Thank you.
Hello
this would probably look like this:
Test again ?
SUMX (
SUMMARIZE (
'AUM Config',
'AUM Config'[IDR_BILLING_GROUP], - don't take this from the fact table
'YourDimTableName'[IDR Config SETTINGNA....], // take the field from the Dim table that you have used in the report
'YourDimTableName'[Adjusted MOD_Groupin....], // take the field from the Dim table that was used in the report
"@MKT", SUM ( 'AUM Config'[MKT_VALUE_USD] )
),
SI ( [@MKT] > 0, [@MKT], WHITE () )
)
Replace the red text with the model match fields.
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
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
77 | |
73 | |
47 | |
39 |
User | Count |
---|---|
137 | |
108 | |
69 | |
64 | |
56 |