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
joepath
Helper II
Helper II

Incorrect total with multiselect filter value.

Hello,

 

My calculated measure is giving incorrect result when I multiselect the ColAFilter, but same worked fine with single select and  multiselect in ColBFilter. below [MeasureA] measure has some caluclation. Now I want this measure to show correct total even when I do multiselect in both the filter.

 

ColA and ColB are coming from different table.

 

Test =

IF(
HASONEVALUE(Table[ColB]),
[MeasureA],
SUMX(VALUES(Table[ColB]),
[MeasureA]
))

 

and when I use the below measure then ColAFilter multiselect work fine but not the ColBFilter.

Test =

IF(
HASONEVALUE(Table[ColA]),
[MeasureA],
SUMX(VALUES(Table[ColA]),
[MeasureA]
))

 

 

 

joepath_0-1623480739974.png

Thanks

5 REPLIES 5
joepath
Helper II
Helper II

Got the result, Created a composite key in fact table for the dimension ColA and ColB,  ColAB= ColA+ColB

Now new measure would be.

Test =

IF(
HASONEVALUE(Table[ColAB]),
[MeasureA],
SUMX(VALUES(Table[ColAB]),
[MeasureA]
))

 

Both filters are working fine.

AlB
Super User
Super User

Hi @joepath 

Can you share a pbix, if necessary with mock data,  that reproduces the problem?

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

Hi @AlB 

pbix contain lot of measures with the data which I can not expose it on public forum,

If [MeasureA] is giving the correct row level count then should we worry about what it is the calculation behind this to calculate the correct total?

negi007
Community Champion
Community Champion

@joepath Your row value is being calcualted basis row context however, your total is being calculated basis filter context which is independent of your values in the rows. That is why your total may not match with the values in the rows. 

 

see more details about row context and filter context

 

https://www.statslab-bi.co.nz/project/row-filter-context-dax/

 

https://www.statslab-bi.co.nz/project/row-filter-context-dax/

 

https://www.sqlbi.com/articles/row-context-and-filter-context-in-dax/

 

 




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

Yes but what is the issue with my caluclation?

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.