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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
trying
Frequent Visitor

Improving Performance Filter Measure Dax

Hi there,

 

i am pretty new to dax and hope for your help with the following measure:

 

Test =
VAR no1 =
    CALCULATETABLE ( VALUES (Orders_Facts[Customer No. ] ) )

VAR no2 =
    FILTER ( no1, [Filter] <> 0 )
RETURN
    COUNTROWS ( no2 )

 

The base for the first measure is the following:

 

Filter =
CALCULATE (
    SUM ( Sales_SCA[Calc. net-net turnover] ),
    Sales_SCA[AC_PL] = "Ist",
    TREATAS ( VALUES ( Orders_Facts[Item No.] ), Sales_SCA[Item No] ),
    TREATAS ( VALUES ( Orders_Facts[Customer No.] ), Sales_SCA[Customer No] )
)

 

the problem is the filter i assume, but i havent found an other way to write it which delivers the correct result.

 

Thank you in advance for your efforts and KR,

KO

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @trying ,


Please try:

Test =
COUNTROWS (FILTER(VALUES(Orders_Facts[Customer No. ] ),ABS([Filter])>0))

 

Best Regards,
Liang
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

3 REPLIES 3
trying
Frequent Visitor

Thanks for the help guys!

V-lianl-msft
Community Support
Community Support

Hi @trying ,


Please try:

Test =
COUNTROWS (FILTER(VALUES(Orders_Facts[Customer No. ] ),ABS([Filter])>0))

 

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

PaulDBrown
Community Champion
Community Champion

You can simplify Test with:

test =
VAR no2 =
    FILTER ( VALUES ( Orders_Facts[Customer No. ] ), [Filter] <> 0 )
RETURN
    COUNTROWS ( no2 )

 

How is the model set up?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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.