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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Theiren
Advocate I
Advocate I

Items with no data, conditional formatting and drill through

I have a matrix visualisation showing some numbers divided by some dimensions. From the visualisation it is possible to drill through to a detail page. Below a scetch of my viz with nonsense data, yellow indicating the number I am about to drill through in my next step:

Theiren_0-1652103505576.png

 

The detail page includes a table visualisation including a column "COMMENTS" calculating comments related to that particular row. Sometimes the result is blank, which hides the whole row if the "Show items with no data" is not chosen. However, when there are no comments, the conditional formatting (link) disappears from the "COMPANY" column.

image.png

This can be avoided by replacing the blanks with zeros. The problem is, that when doing so, the drill through stops working, and all the rows become visible.

image.png

I have tried with:

1) IF(ISBLANK(SUM(comment[count_of_comment])), 0, SUM(comment[count_of_comment]))
2) SUM(comment[count_of_comment]) + 0
3) COALESCE(SUM(comment[count_of_comment]), 0)

All of the above result to the same issue.

Any ideas how to get the drill through working again (with conditional formatting working as well)? Thanks!






1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @Theiren ,

 

Your issue should be caused by relationship between tables. I think there should be a relationship based on size columns between the data table (in matrix) and a company table (in table visual).

I create a sample to have a test.

Data table:

RicoZhou_0-1652339163413.png

Company table:

RicoZhou_1-1652339169231.png

Comment table:

RicoZhou_2-1652339174416.png

I think you can try this code to achieve your goal.

Measure = 
VAR _List = CALCULATETABLE(VALUES('Table'[Size]),ALLSELECTED('Table'[Size]))
RETURN
IF(MAX(Company[SIZE]) IN _List,CALCULATE(SUM(Commnet[count_of_comment])+0))

Result is as below.

RicoZhou_3-1652339223763.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Theiren
Advocate I
Advocate I

Hi @v-rzhou-msft 

Thanks a lot for your reply. Indeed, I noticed already earlier, that my issue must be related to table relations, because if I took values from one table only, this didn't happen.

I modified your pbix a bit and added three example tables which describe more my real world case. The measure I created based on your suggestion was:

 

commentCount2 = 
VAR _List = CALCULATETABLE(VALUES(Theiren_Orders[Size]), ALLSELECTED(Theiren_Orders[Size]))
RETURN
IF(MAX(Theiren_Orders[Size]) IN _List, CALCULATE(SUM(Theiren_Comments[count_of_comment]) + 0))

 


And this did the trick (the only diff compared to yours was that I have the size information only available in the "Orders" table, but it worked like this anyway)! I would like to attach the modified pbix here to help others, but I can't see any attachment options.

v-rzhou-msft
Community Support
Community Support

Hi @Theiren ,

 

Your issue should be caused by relationship between tables. I think there should be a relationship based on size columns between the data table (in matrix) and a company table (in table visual).

I create a sample to have a test.

Data table:

RicoZhou_0-1652339163413.png

Company table:

RicoZhou_1-1652339169231.png

Comment table:

RicoZhou_2-1652339174416.png

I think you can try this code to achieve your goal.

Measure = 
VAR _List = CALCULATETABLE(VALUES('Table'[Size]),ALLSELECTED('Table'[Size]))
RETURN
IF(MAX(Company[SIZE]) IN _List,CALCULATE(SUM(Commnet[count_of_comment])+0))

Result is as below.

RicoZhou_3-1652339223763.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.