Forum Discussion
Blank graph when incorporating date table
Hi guys,
I have the following issue: I wrote my measure, but when i put a date table date on the x-axis, the table tuns blank. I know it has to do with my measure, and that somewhere in there is should refer to the date table, but i'm not seeing it.
I used this code:
5 Replies
- DOLEARY85Resident Rockstar
Hi,
Check your date table has a relationship to the Herstelverzoeken table in model view.
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
- QwertyMartijnHelper II
Hi,
It does. Thought of that at first too.
- DOLEARY85Resident Rockstar
Strange, as long as it's connected to a date field there shouldn't be an issue.
Things i'd try next:
Might sound really simple but have you tried deleting the visual and readding it?
Does the date field have data in?
Are there any visuals that the date field work in?
If you still have no luck, is there any way you can share the PBIX file?
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
- data_freakRegular Visitor
Hello QwertyMartijn
I think you need to make sure that your measure considers the relationship between the "Herstelverzoeken" table and the date table. You can do this by using the appropriate column from the date table in your measure. Here's an updated version of your code that incorporates the date table:
CALCULATE(
COUNT(Herstelverzoeken[Dossieritem]),
FILTER(
Herstelverzoeken,
Herstelverzoeken[Dossieritemcode] = "63"
&& RELATED('DateTable'[Date]) = MAX('DateTable'[Date])
)
)
Please note that you need to replace 'DateTable'[Date]’ with the actual column name from your date table.
Now I assume that there is a relationship between the "Herstelverzoeken" table and the date table based on a common column (e.g., a date column). If such a relationship doesn't exist, you may need to establish it using Power BI's relationship editor.
Try using this updated code, and hopefully, it resolves the issue with the table turning blank when you put a date table on the x-axis.
If this has solved your problem, kindly mark my post as solution.
Cheers
- QwertyMartijnHelper II
Update: it was as simple as: the date in my herstelverzoeken was formatted as date + time in the power query. Thanks for the responses!