Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Bug with context-depending calculated column?

Hi all,
I have just come across a (as it seems to me) really annoying bug. I have a table of periods to which I add a calculated column, which has a value equal to whether the period is used in a specific data table or not. As far as I understand it, this column is calculated everytime I refresh the dataset and therefore completely independent of the current filter-context in my visuals. But it turns out, that in some filter-contexts it is neither 1 nor 0 but empty. I had to do experiments with a matrix, where I would control the filter context via the rows and columns and have the calculated column in the value field.

Nussi649_0-1645110551486.png

in the rows are the period indizes and in the columns another dimension. shouldn't the values be all the same across a row as the calculated column can only depend on its row in the periods table at the time of dataset setup? what is happening here?

Thanks in advance!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I found the solution.
The periods table was indirectly linked to the table containing the dimension in the first matrix view (via a third table which is linked to both with a two-way connection). So that when filtering for that dimension it would filter the third table for that selection, which then would not contain any entries for that specific selection, which would then filter out all periods (as there were none), which would finally lead to the periods table being empty and containing no information about whether it's being used or not.

Long story short: If you happen to come across this error, check for indirect connections between your tables especially two-way connections

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

I found the solution.
The periods table was indirectly linked to the table containing the dimension in the first matrix view (via a third table which is linked to both with a two-way connection). So that when filtering for that dimension it would filter the third table for that selection, which then would not contain any entries for that specific selection, which would then filter out all periods (as there were none), which would finally lead to the periods table being empty and containing no information about whether it's being used or not.

Long story short: If you happen to come across this error, check for indirect connections between your tables especially two-way connections

parry2k
Super User
Super User

@Anonymous can you share what Dax expression you are using? Instead of checking it in the matrix visual by using it on value, which will turn this into a measure, why not check in the data table what value you are getting for the column.

 

Read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

 

used in progress = IF(
CALCULATE(COUNTROWS('Source Tabelle1'), 
          FILTER(ALL('Source Tabelle1'), 'Source Tabelle1'[Current Period] = [ID])) > 0,
1,
0)

 

Nussi649_0-1645111337175.png

In the data table it looks alright, I noticed the error when it would filter incorrectly at some point where I used the column as filter criterion.
It looks to me like there was some sort of error calculating it because the value is null.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.