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, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare 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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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