Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello Team,
Today I have encountered strange issue that I can't understand.
I have an AAS model where I created a measure:
CALCULATE('Measures Table'[Spend],SELECTEDVALUE(Company[txt_country])='Supplier Country'[txt_country])
and it is working fine
Now I switched the model to SSAS where the model and the underlying dataset is exactly the same as in this AAS
Everything in this SSAS model is working the same as in AAS, except that measure which is throwing a error that "SELECTEDVALUE has been used in a True/False expression..."
I found out that when I apply this measure with FILTER function it is working fine:
CALCULATE('Measures Table'[Spend],FILTER('Supplier Country',SELECTEDVALUE(Company[txt_country])='Supplier Country'[txt_country]))
1. Any reason why is that differs between those, basically the same, 2 models?
2. I always thought that the second argument in CALCULATE function is the exact equvalent of FILTER function, so why do I need to actually put FILTER function so it could work here?
Best
Solved! Go to Solution.
https://docs.microsoft.com/en-us/dax/calculate-function-dax
A Boolean expression filter is an expression that evaluates to TRUE or FALSE. There are several rules that they must abide by:
Beginning with the September 2021 release of Power BI Desktop, the following also apply:
Total sales on the last selected date =
CALCULATE (
SUM ( Sales[Sales Amount] ),
'Sales'[OrderDateKey] = MAX ( 'Sales'[OrderDateKey] )
)
That means
CALCULATE('Measures Table'[Spend],SELECTEDVALUE(Company[txt_country])='Supplier Country'[txt_country])
works fine because of the update.
SSAS have not get the update yet.
Okay, that make sense now.
Thank you!
https://docs.microsoft.com/en-us/dax/calculate-function-dax
A Boolean expression filter is an expression that evaluates to TRUE or FALSE. There are several rules that they must abide by:
Beginning with the September 2021 release of Power BI Desktop, the following also apply:
Total sales on the last selected date =
CALCULATE (
SUM ( Sales[Sales Amount] ),
'Sales'[OrderDateKey] = MAX ( 'Sales'[OrderDateKey] )
)
That means
CALCULATE('Measures Table'[Spend],SELECTEDVALUE(Company[txt_country])='Supplier Country'[txt_country])
works fine because of the update.
SSAS have not get the update yet.
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
8 | |
6 |