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.
Hi All,
Greetings!!!
I have been working on a Power BI report, where I have a table visual with some columns from dimension and fact tables.
Out of these columns, there is one column named "Offer End Date". I need another column named "Today" that shows current date and "DaysRemaining" which shows the difference between the two date columns.
DImension -> 12568 rows
Fact -> 17 rows (test data)
For this, I created one measure "#Today := TODAY()" and added it to the table visual. As soon as I add the column, the rows get duplicated. Ideally, the table visual should show only 17 rows, but after addition of measure in table visual, the row count has increased drastically.
I am using LIVE Connection.
Please suggest how can I solved this issue.
Solved! Go to Solution.
HI @Anonymous,
It sounds like measure expression expands your records hidden by power bi.
If that is the case, I'd like to suggest you add 'if statement' to your formula to check if the current fact table exists in correspond records.
Measure =
VAR curr =
CALCULATE ( SUM ( Fact[Amount] ), VALUES ( Table[Date] ) )
RETURN
IF ( curr <> BLANK, TODAY )
Regards,
Xiaoxin Sheng
Use New measure :
Hi Swati,
Thanks for the support.
I am able to get the date difference working fine. But still, I am unable to get TODAY's date. Difference is working as expected but Today is still duplicating data.
Regards
Hi Pyshglulr,
Try creating a custom column (Today date ) in power query editor itself.
Hi Swati,
I am using LIVE CONNECTION.
HI @Anonymous,
It sounds like measure expression expands your records hidden by power bi.
If that is the case, I'd like to suggest you add 'if statement' to your formula to check if the current fact table exists in correspond records.
Measure =
VAR curr =
CALCULATE ( SUM ( Fact[Amount] ), VALUES ( Table[Date] ) )
RETURN
IF ( curr <> BLANK, TODAY )
Regards,
Xiaoxin Sheng
@Anonymous , It should not do that. Try like the right click on fact, create a new measure then try and see does it make any difference.
Or try a measure like
calculate(Today(), filter(fact, not(isblank([measure])))
Hi Amit,
Thanks for looking into the issue.
I have tried creating measure on fact table and dimension table. It doesn't make any difference.
Also, I have created the meausre TODAY as you suggested, but to no avail.
I am still stuck at this.
Regards