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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Surekha_PM
Helper III
Helper III

Filter Issue

Hello,

 

Here is my data from one table to create a line graph;

 

DateCategorySub-CategoryValue
1-May-24Health & FitnessHealth & Fitness215
1-May-24Health & FitnessYoga Matt409
1-May-24Health & FitnessHealth & Fitness115
1-May-24Health & FitnessShoes234
1-May-24BeautyBeauty176
1-May-24BeautyLipstick104
1-May-24BeautyLipbalm354
1-May-24BeautyBeauty153
1-May-24StationaryStationary318
1-May-24StationaryStationary197
1-May-24StationaryStationary318
1-May-24StationaryNotebook104


In X-axis we have added the date and Y-Axis has the value Sub-Category wise.

Now we have a global filter of Sub-Category and category. What we are trying to do is when a user is selecting Category - Health & Fitness he should see the comparison of the value of category and sub-category. The graph should show total of health & fitness data in one line and Shoes and yoga matt in another line. And if a user is selecting shoes in sub-category the user should see the total of health & fitness compared with shoes only.

I used Removefilter option and created two measurement and added in the line graph which is working fine. But when the filter is set to "All" the data for both category is showing same which is wrong.

Any Suggestions for this?

Regards,
Surekha

 

2 REPLIES 2
Anonymous
Not applicable

Hi @Surekha_PM 

You can try the following measures.

Total_Cate = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Sub-Category] in VALUES('Table'[Category])))
Total_sub = CALCULATE(SUM('Table'[Value]),FILTER('Table',NOT('Table'[Sub-Category] in VALUES('Table'[Category]))))

Output

vxinruzhumsft_0-1717378862301.png

Best Regards!

Yolo Zhu

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

 

 

HI @Anonymous 

Currently, I am using this function, which is working fine but somehow it is not showing a proper graph. All the data for categories and sub-categories show the same number. 

Total Cate =  CALCULATE(sum('Table'[Value1])/SUM('Table'[Value2]),'Table'[Sub-Category] = 0,REMOVEFILTERS('Table'[Category]))

Total Sub =  CALCULATE(sum('Table'[Value1])/SUM('Table'[Value2]),'Table'[Sub-Category] = 1,REMOVEFILTERS('Table'[Sub-Category]))

Here we have created another table and created a function that says if Category = Sub-Category, then 0 or else 1. 

The graph is supposed to be like this:
Surekha_PM_0-1717394441389.png

But instead it is coming like this

Surekha_PM_1-1717394472467.png

Both the parameter is showing same number


Can you check now.

Regards,
Surekha

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors