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,
I have one fact table with about 1,2M rows and a few dim tables, basic star schema. In powerBi canvas I created simple table including a few columns from dim tables and a measure counting rows number in the fact table.
And I found strange behaviour within different measure :
Measure:=
DATEDIFF(
SELECTEDVALUE(
'dimtable'[date]
),
TODAY(),
DAY
)
I don't know why but using TODAY() makes visual performance dramatically slow. For an example I used only TODAY() as a measure and I received an error with lack of memory , I checked it again but I reduced numbers of columns in visual and then it worked but It gave me results of all possible connections between data from dim tables from which I took columns.
I am trying to undestand this behavour as it is strange to me, and the same for some static value:
ExampleMeasure:=
5
Adding above measure to any table visual even with really small dataset is extemely slow... why ?
But my final question is how can I add today as part of my measure to make it work efficiently.
Thanks in advance !
Unfortunately both solutions don't work 😕
I am sure that today() causing it cause below measure works immediately
Measure:=
MAX('dimtable'[date])
but
Measure:=
Var T = TODAY()
Return
DATEDIFF(
MAX('dimtable'[date]),
T ,
DAY
)
engine is not even able to calculate it... Instead of today() I tried even DATE(2022,11,09) and still the same. It doesn't matter whether these function are closed in variables or not.
Hi @Frajzerr
Try to keep TODAY() as a variable and test that measure performance again:
I'm not sure about your model and visual but you can change the SELECTEDVALUE to MAX
Measure:=
Var _T = TODAY()
Return
DATEDIFF(
MAX('dimtable'[date]),
_T ,
DAY
)
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn | Twitter | Blog | YouTube
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
12 | |
10 | |
6 |