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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Heinrich
Post Partisan
Post Partisan

Power BI - DAX Query

Hello

I have a DAX Query that does not work as supposed

// DAX Query
DEFINE
	VAR __DS0FilterTable = 
		FILTER(
			KEEPFILTERS(VALUES('CQD'[PSTN Trunk FQDN])),
			NOT('CQD'[PSTN Trunk FQDN] IN {"sbc02-id.axa.co.id"})
		)

	VAR __DS0Core = 
		FILTER(
		SUMMARIZECOLUMNS(
			'CQD'[PSTN Trunk FQDN],
			"SumTotal_Stream_Count", CALCULATE(SUM('CQD'[Total Stream Count])),
			"SumPSTN_NER_Good_Percentage", CALCULATE(SUM('CQD'[PSTN NER Good Percentage]))
		),
			[SumPSTN_NER_Good_Percentage] < 100,
			[Total Stream Count] > 1			
		)
		
	VAR __DS0PrimaryWindowed = 
		TOPN(501, __DS0Core, 'CQD'[PSTN Trunk FQDN], 1)

EVALUATE	
	    SELECTCOLUMNS(

        __DS0PrimaryWindowed,   // Use the filtered result set

        "SBC", 'CQD'[PSTN Trunk FQDN],  // Rename 'PSTN Trunk FQDN' to SBC

        "NER", [SumPSTN_NER_Good_Percentage],  // Rename 'SumPSTN_NER_Good_Percentage' to NER
        
        "TOTAL STREAM", [SumTotal_Stream_Count]  // Rename 'SumTotal_Stream_Count' to TOTAL STREAM

        
    )

ORDER BY
	"SBC"

 

When I remove  [Total Stream Count] > 1 then I get a result that filters also  [Total Stream Count] less than 100.
But  [Total Stream Count] should have all results

 

Regards

Heinrich

1 ACCEPTED SOLUTION
pankajnamekar25
Super User
Super User

Hello @Heinrich 

 

try this

DEFINE

    VAR __DS0FilterTable =

        FILTER(

            KEEPFILTERS(VALUES('CQD'[PSTN Trunk FQDN])),

            NOT('CQD'[PSTN Trunk FQDN] IN {"sbc02-id.axa.co.id"})

        )

 

    VAR __DS0Core =

        FILTER(

            SUMMARIZECOLUMNS(

                'CQD'[PSTN Trunk FQDN],

                "SumTotal_Stream_Count", CALCULATE(SUM('CQD'[Total Stream Count])),

                "SumPSTN_NER_Good_Percentage", CALCULATE(SUM('CQD'[PSTN NER Good Percentage]))

            ),

            [SumPSTN_NER_Good_Percentage] < 100

        )

       

    VAR __DS0PrimaryWindowed =

        TOPN(501, __DS0Core, 'CQD'[PSTN Trunk FQDN], 1)

 

EVALUATE   

    SELECTCOLUMNS(

        __DS0PrimaryWindowed,

        "SBC", 'CQD'[PSTN Trunk FQDN],

        "NER", [SumPSTN_NER_Good_Percentage],

        "TOTAL STREAM", [SumTotal_Stream_Count]

    )

 

ORDER BY

    "SBC"

 

Thanks,
 Pankaj Namekar | LinkedIn

If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

View solution in original post

3 REPLIES 3
burakkaragoz
Super User
Super User

Hi @Heinrich ,

 

If you're trying to filter a table to only return rows where Status = "Active", you can use something like this:

FILTER (
    'YourTable',
    'YourTable'[Status] = "Active"
)

Or if you're using it inside a measure or calculated table, you might need to wrap it with something like CALCULATETABLE:

CALCULATETABLE (
    'YourTable',
    'YourTable'[Status] = "Active"
)

Make sure:

  • The column name is spelled exactly as it appears in your model (case doesn’t matter, but spaces and typos do).
  • The value "Active" matches exactly what's in your data — sometimes there are extra spaces or different casing.

Let me know if you're using this inside a measure, calculated column, or visual — the context can change how the DAX behaves.

 

If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
translation and formatting supported by AI

v-pnaroju-msft
Community Support
Community Support

Thankyou, @pankajnamekar25, for your response.

Hi @Heinrich,

We sincerely appreciate your inquiry posted on the Microsoft Fabric Community Forum.

Please find attached the screenshot and the PBIX file, which we hope will assist you in resolving the issue:

vpnarojumsft_0-1747802732843.png

If you find our response helpful, we kindly request you to mark it as the accepted solution and provide kudos. This will help other community members who might be facing similar queries.

Should you have any further questions or require additional assistance, please feel free to contact the Microsoft Fabric Community.

Thank you.

pankajnamekar25
Super User
Super User

Hello @Heinrich 

 

try this

DEFINE

    VAR __DS0FilterTable =

        FILTER(

            KEEPFILTERS(VALUES('CQD'[PSTN Trunk FQDN])),

            NOT('CQD'[PSTN Trunk FQDN] IN {"sbc02-id.axa.co.id"})

        )

 

    VAR __DS0Core =

        FILTER(

            SUMMARIZECOLUMNS(

                'CQD'[PSTN Trunk FQDN],

                "SumTotal_Stream_Count", CALCULATE(SUM('CQD'[Total Stream Count])),

                "SumPSTN_NER_Good_Percentage", CALCULATE(SUM('CQD'[PSTN NER Good Percentage]))

            ),

            [SumPSTN_NER_Good_Percentage] < 100

        )

       

    VAR __DS0PrimaryWindowed =

        TOPN(501, __DS0Core, 'CQD'[PSTN Trunk FQDN], 1)

 

EVALUATE   

    SELECTCOLUMNS(

        __DS0PrimaryWindowed,

        "SBC", 'CQD'[PSTN Trunk FQDN],

        "NER", [SumPSTN_NER_Good_Percentage],

        "TOTAL STREAM", [SumTotal_Stream_Count]

    )

 

ORDER BY

    "SBC"

 

Thanks,
 Pankaj Namekar | LinkedIn

If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.