The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi,
In a financial reports on Intercompany accounting I have 1 slicer that drives the choice on the Company.
With this same slicer I would like to remove the lines that have the same Intercompany code (INTERCO_CD) as the Company Code selected.
I tried to create a measure and to applied the second filter with it on the table.
Solved! Go to Solution.
Hi @Samkar78 ,
Try this.
Measure =
VAR _company_cdForSlicer = VALUES('Table 2'[COMPANY_CD])
VAR _interco_cd = SELECTEDVALUE('Table'[INTERCO_CD])
VAR _compant_cd = SELECTEDVALUE('Table'[COMPANY_CD])
RETURN
IF( NOT ISFILTERED('Table 2'[COMPANY_CD]),
SUM('Table'[AMOUNT]),
IF( NOT _compant_cd IN _company_cdForSlicer,BLANK(),
IF(_interco_cd IN _company_cdForSlicer,BLANK(),SUM('Table'[AMOUNT]))
)
)
Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks @v-zhouwen-msft this solution works but... I can't use the orginal slicer which is a hierarchy slicer. I have to click the COMPANY_CD of the unlinked table.
I continue to look for an acceptable solution for users.
thanks @v-zhouwen-msft that's half of the expected result 😉 you exclude the selected Company Code.
the expected result is this one, based on you example :
The goal is to have 1 Slicer that combine 2 filters :
Hi @Samkar78 ,
Try this.
Measure =
VAR _company_cdForSlicer = VALUES('Table 2'[COMPANY_CD])
VAR _interco_cd = SELECTEDVALUE('Table'[INTERCO_CD])
VAR _compant_cd = SELECTEDVALUE('Table'[COMPANY_CD])
RETURN
IF( NOT ISFILTERED('Table 2'[COMPANY_CD]),
SUM('Table'[AMOUNT]),
IF( NOT _compant_cd IN _company_cdForSlicer,BLANK(),
IF(_interco_cd IN _company_cdForSlicer,BLANK(),SUM('Table'[AMOUNT]))
)
)
Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @some_bih ,Thanks for your quick reply, I will add more.
Hi @Samkar78 ,
The Table data is shown below:
Please follow these steps:
1. Use the following DAX expression to create a table
Table 2 = VALUES('Table'[COMPANY_CD])
2.Put field into slicer.
3.Use the following DAX expression to create a measure
Measure =
VAR _company_cd = VALUES('Table 2'[COMPANY_CD])
VAR _interco_cd = SELECTEDVALUE('Table'[INTERCO_CD])
RETURN
IF( NOT ISFILTERED('Table 2'[COMPANY_CD]),
SUM('Table'[AMOUNT]),
IF(_interco_cd IN _company_cd,BLANK(),SUM('Table'[AMOUNT]))
)
4.Final output
Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@some_bih The data model is pretty simple on this part. I got a fact table 'GL' and a dimension table 'COMPANY'
If add a new column Yes/No based on inter company code , I will remove ALL inter company lines and not specifically the chosen company selected in the Company Slicer.
Hi @Samkar78 based on your data, without model and other details, possible solution
- as you mentioned button is to use bookmark features in Power BI, check link or
- create separate column for intercompany flag with yes / no values (I am reporter for Intercompany :))
Proud to be a Super User!
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
18 | |
18 | |
17 | |
15 | |
13 |
User | Count |
---|---|
36 | |
35 | |
19 | |
18 | |
18 |