Q:

DAX - Different Granularities

I have a Diff Grain Type Question.
I have a Fact table with 2 measures - Amount and Share_amount
EG
Name    Location    Amount  Share_amount
John    Ireland     100     50
John    UK          100     50
fred    USA         200     200
Bob     france      300     150
Bob     spain       300     150

I'd like to display the Amount but SubTotal/Total by Share_amount
In the pivot I'd like to see:
John        100
John Total  100
fred        200
Fred total  200
Bob         300
Bob Total   300

I know I can Blank() the amount if ISFILTERED() Location
But I'd like to show the amount (unshared) but keep the totals correct
Is there any way to do this in DAX
Thanks

A:

I think what you need is something like this:
DEFINE MEASURE 'Fact'[RealAmount] =
    IF (
        COUNTROWS ( VALUES ( Fact[Location] ) ) = 1,
        SUM ( Fact[Amount] ),
        SUM ( Fact[Share_amount] )
    )

It is not tested but should work, let me know if it works for you.

