Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi folks,
I’m having trouble linking my fact table and my calendar table in the PBI report. The relationship is actually OK but some DAX functions (e.g. DATEADD) are not working while reffering to both tables. Can anyone help pls?
I have two tables.
I would be super grateful for any suggestions and recommendations, thanks guys!
Thanks @v-jingzhang for your effort! Much appreciated!
Basically I would be super greatful for any tips that would do the trick which I am after (as described in the threat) so... anyone? anything? 😄
Thank you!
If you use 'Calendar (D)'[YearMonth] to replace 'Calendar (D)'[Date] in DATEADD function, you will get the same result as when using 'Metric Values (F)'[DATE_PERIOD_VALUE].
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi _Jing,
thank you very much for your quick catch! This helped me to work with the Date type columns to visualize the numbers:
However if I am to use the "CODE_PERIOD_VALUE" from the very same table to visualize the numbers I am not able to:
Is there any way how to do this pls? The reason behind is that for some axis formatting purposes I would like to use the text field (CODE_PERIOD_VALUE) over the date field (YearMonth).
Thank you very much!
It is because you are using HASONEVALUE in the measure while one CODE_PERIOD_VALUE may have multiple related YearMonth Values. In this case, HASONEVALUE returns FALSE and IF returns Blank(). Please use other functions to replace HASONEVALUE.
Usually when using Time Intelligence functions like DATEADD, the referenced date column is expected to have continuout unique date values. I would suggest adding a standard date table into your model and use date column from this standard date table in DATEADD functions. Connect your current calendar table to standard date table on date columns.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Thanks again _Jing for your quick response!
And sorry to bother you again! I have tried adding the Calendar dates (D) table using:
And I linked the table to my previous Calendar (D) using date columns.
Now when I am trying to simplify the measure's DAX code I am still noticing some "strange" behaviour:
I have removed the HASONEVALUE function and used the new Calendar dates (D) table to get the previous months values. On the lower right table I am using the YearMonth from the Calendar dates (D) table and the visual is working as expected. However on the lower left table I am using the YearMonth from the Calendar (D) table (sorry for the same column name) and the values for the previous months are already not visible... and what is "strange" is that the total is calculated correctly for the Website visits previous month.
Any ideals pls? Thanks!
Sure! I have updated the file under the original link: https://drive.google.com/file/d/1w7k_xO1l4nT8lPCN19a88IrTFVC727kK/view?usp=sharing
Thanks!
Sorry for the late response as I still haven't figured out the reason...
I think it is probably caused by the relationship. When I replaced [Website visits] with MAX('Calendar dates (D)'[Date]) in a new measure, I found it also returns blank. It means that it didn't pass the valid filter to 'Calendar dates (D)'[Date] column to get the correct dates but got blank, so the measure returns blank. I don't know why this happens...
Regards
Jing
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
124 | |
79 | |
50 | |
38 | |
38 |
User | Count |
---|---|
196 | |
80 | |
70 | |
51 | |
42 |