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

How to filter with a sumx measure that creates a visual table

When I create a measure with sumx that creates a visual table, I can only filter in the matrix and or table.
The question is that I want to gain insight into whether the traffic of our website fills hotels that are not filled by the competitor. Sometimes we fill hotels together and sometimes we cover it because they can't do it.

The two measures come from two aparate fact tables.

measure 1 SUM X Covering competitor =
var hotel_c =
CALCULATE(IF([weekplanning_competitor] >= 1,1,0 ))
Return
 SUMX(addcolumns(summarize(
  'Total_planningcompetitor','Total_planningcompetitor'[name_hotels],'Total_planningcompetitor'[week_number]),
    "p", hotel_c),[p])

measure 2  
SUM X Covering  =
var hotel =
CALCULATE(IF([weekplanning] >= 1,1,0 ))
Return
 SUMX(addcolumns(summarize(
  'Total_planning','Total_planning'[name_hotels],'Total_planning'[week_number]),
    "w", hotel),[w])

For the filtering of the matrix and table I use this measure. But could I also process this in measure 1 & 2, for example?

measure 3 Correction sumx = IF(([SUM X Covering competitor] =  
[SUM X Covering ]) && [SUM X Covering competitor] <> BLANK() && [SUM X Covering] <> BLANK(),1,0)

1.png

The outcome I need to have to use it in other visualizations

2.png

I hope someone can help me. Thanks in advance.



2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@madepassionned , You can use visual level filter

 

or

 

Sumx(filter(Values(Table[Name_of_hotel]), [SUM X Covering] =1) , [SUM X Covering])

View solution in original post

This works : 

Filter covering =
Sumx(FILTER(Values('table[Name_of_hotel]),
[SUM X Covering competitor] = BLANK() && [SUM X Covering]=1),
[SUM X Covering])

View solution in original post

6 REPLIES 6
msbiuser1
Advocate I
Advocate I

Yes @saravanan_p  that works. @madepassionned Hence the solution, simple. Kindly mark it as solution plz

amitchandak
Super User
Super User

@madepassionned , You can use visual level filter

 

or

 

Sumx(filter(Values(Table[Name_of_hotel]), [SUM X Covering] =1) , [SUM X Covering])

Your logic is wrong, it yeilds all data for all sumx coverng = 1. And @madepassionned  how can this get acccepted as solution. Anyways keep community healhty by supporting other non super users too.

This works : 

Filter covering =
Sumx(FILTER(Values('table[Name_of_hotel]),
[SUM X Covering competitor] = BLANK() && [SUM X Covering]=1),
[SUM X Covering])

It does not work in the filterpane for a another visualisation.. only for a matrix or table


1.png

saravanan_p
Resolver III
Resolver III

Use filter pane and go to field weekplanning_Competetor and uncheck other values and check only blanks. Your result would be populated. 

KIndly give thumps up and mark as solution

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.