Quantcast
Channel: SQL Server Analysis Services forum
Viewing all articles
Browse latest Browse all 14337

tabular: set measure to blank() for certain dimensions

$
0
0

Hi, I know there is no scope() equivalent in dax but i'm hoping there's some other combination of functions that will give me the same result

I have a stock movement fact table and I have two running totals on it. One is is a 'stock to date' value while the other is a 'season to date' that resets to 0 at the start of each season (ie a custom YTD running total)

The season to date value is created using a second date dim because the season start and end dates aren't static and change year to year.

Here is the DAX for the season to date measure

Season to Date:=[Sum Quantity](ALL(dimDate),
                FILTER(
                  ALL(dimTransactionSeason),
                  dimTransactionSeason[DayOfSeasonID]<=MAX(dimTransactionSeason[DayOfSeasonID])
                ),
                VALUES(dimTransactionSeason[TransactionSeasonID])
             )

I've set the date dim to be ignored, but that just means that the current season to date value is repeated. I'd rather the result be blank.

Is there a dax function or combination of functions that will allow me to check whether the measure is being sliced by dimDate and replace it with BLANK()?

I though i could use some kind of logic like countrows(dimdate)<>countrows(all(dimdate)) but i'm too new to DAX to figure this out by myself..

Am I on the right track or is this not possible with tabular at the moment?

thanks


Jakub @ Adelaide, Australia


Viewing all articles
Browse latest Browse all 14337

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>