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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
timba_bng
New Member

Help adding dynamic filter to run a query against a dataset

Hello, I copied this DAX query from Performance analyzer. I want to be able to be able to make the output dynamic by the  ManagerReport'[name_manager] slicer in the report. The output always pulls all the name_manager column data in the report.@v-yiruan-msft gave a solution for something similar but I've been unable to achieve this. Please help.

 

// DAX Query
DEFINE
VAR __DS0Core = 
FILTER(
KEEPFILTERS(
VALUES('ManagerReport'[name_manager])),
AND('ManagerReport'[name_manager]= MAX('ManagerReport'[name_manager])
AND(
SUMMARIZECOLUMNS(
ROLLUPADDISSUBTOTAL(
ROLLUPGROUP(
'ManagerReport'[name_manager],
'ManagerReport'[name_employee],
'ManagerReport'[Color Coding],
'ManagerReport'[content_title]
), "IsGrandTotalRowTotal"
),
"MinColor_Coding", IGNORE(CALCULATE(MIN('ManagerReport'[Color Coding])))
)
),
OR(
OR(
OR(
NOT(ISBLANK('ManagerReport'[name_manager])),
NOT(ISBLANK('ManagerReport'[name_employee]))
),
NOT(ISBLANK('ManagerReport'[Color Coding]))
),
NOT(ISBLANK('ManagerReport'[content_title]))
)
)
VAR __DS0PrimaryWindowed = 
TOPN(
502,
__DS0Core,
[IsGrandTotalRowTotal],
0,
'ManagerReport'[name_manager],
1,
'ManagerReport'[name_employee],
1,
'ManagerReport'[Color Coding],
1,
'ManagerReport'[content_title],
1
)
EVALUATE
__DS0PrimaryWindowed
ORDER BY
[IsGrandTotalRowTotal] DESC,
'ManagerReport'[name_manager],
'ManagerReport'[name_employee],
'ManagerReport'[Color Coding],
'ManagerReport'[content_title]

 

1 REPLY 1
ghoshabhijeet
Solution Supplier
Solution Supplier

@timba_bng Thanks for posting your query.

 

Would request you to share some sample data or if possible the pbix file to work on. Thanks!

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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