Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
vmakhija
Post Prodigy
Post Prodigy

Custom Totals in Matrix table (SUMX, HASONEVALUE)

Hello All
I have some DAX related question.


Let me explain my scenario - I have a matrix table which shows companies data (each company has its data in different currency) and there is a measure which is dynamically showing data in USD for each company

At the total level for matrix, the totals are inaccurate as currency conversion at total level is not relevant as such.
So I am using SUMX to do the totals for all the companies - i.e. each company's USD converted number will add up together to show the total.
Its fine till here.

 

However, what I am using here is HASONEVALUE function to check if I am at company level or total level and use SUM or SUMX based on that.
But if in case my user removes company code and lets say puts a different field, then my measure will fail as it is checking HASONEVALUE for company code only and not the new field just added by user.

 

Have any of you encountered this or have any suggestions?

 

Regards

5 REPLIES 5
Greg_Deckler
Super User
Super User

So the users have access to edit your report? How are you sharing the reports via the Service or Desktop?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler

Yes, my users have edit access to the report. I am sharing the report via Service.


Regards

@vmakhija,

 

As far as I know, you'll need to rewrite the measure. By the way, you may take a look at ISINSCOPE.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-chuncz-msft

you mean write multiple measures, right?

I think ISINSCOPE will have the same shortcomings as what HASONEVALUE has in my scenario.

 

Regards

@v-chuncz-msft Any further inputs or ideas on this? I am actually stuck on this and don't have further ideas on how to proceed ahead. Regards

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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