Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hi all,
I am trying to understand more about filter contexts in DAX. For this, I have downloaded the Adventure 2020 model from this link https://learn.microsoft.com/en-us/dax/dax-sample-model
I started with creating a a simple matrix visual with "Year" on the rows and a measure "Number of dates in range" which calculates the maximum visible date in the values field
When I do this I am seeing one row in the visual where the year is blank. I am trying to figure out what is causing this. I had a few sales related measures in the visual initally. First thought was there there could be sales in the sales table which do not have a corresponding "order date" in the date table. Removing those sales related measures didn't do anything as I can still see those blank values
Hopefully, the screenshot below might help
I also added year slicer. Now this year slicer shows a blank value for some reason. I checked the date table but couldn't find anything
Here is the measure I created
Number of dates in range =
VAR LastdateinContext =
MAX('Date'[date])
VAR DatesinRange =
FILTER ( 'Date', 'Date'[Date] <= LastdateinContext )
VAR AllDates =all('Date'[Year])
RETURN
COUNTROWS(AllDates)
I am sure I am missing something very obvious. But I'm just not able to figure out what that is. I looked at the model to check if there are any odd looking dates in the tables that should not be there but have not been able to find anything
Any help will be much appreciated!
Thank you
Solved! Go to Solution.
Watch this Why is there a blank in my Power BI slicer??? - YouTube
As soon as you delete the two inactive relationships between date table and othe tables in model, blank row goes away. I am referring to the Adventureworks sample pbix file 2020.
I found the culprit. The shipdatekey in the Sales table has blanks. I didn't know inactive relationships on columns with blanks can cause blanks to appear like that
@talespin
Thanks for that ! Removing the inactive relationships fixed it. But I don't know what is driving that behaviour. I also tried to check for dirty data like in the video you have linked to but couldn't find anything standing out
How would you avoid these blanks in a situation where you certainly require an inactive relationship ?
Thanks
hi @Uniqueusername ,
In case its a data issue, you should include blanks.
Otherwise you can just apply filter from filter panel to exclude blanks.
Watch this Why is there a blank in my Power BI slicer??? - YouTube
As soon as you delete the two inactive relationships between date table and othe tables in model, blank row goes away. I am referring to the Adventureworks sample pbix file 2020.
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
33 | |
14 | |
14 | |
12 | |
9 |