Forum Discussion
Show only selected Company value
- 7 months ago
Hi rajasekaro , Thank you for reaching out to the Microsoft Community Forum.
Please try:
Currency Rule :=VAR curr =
SELECTEDVALUE ( 'Currency selection'[Currency] )
VAR comp =
SELECTEDVALUE ( 'COMPANYMASTER'[COMPANYMASTERID] )
RETURN
SWITCH (
TRUE(),
curr = "INR" && comp = "00030", [Final Amount],
curr = "USD" && comp <> "00030", [Final Amount],
BLANK()
)
If it didn’t give expected output, please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot). Include all the necessary details, detailing your scenario and issue as clearly and fully as possible.
Do not include sensitive information. Do not include anything that is unrelated to the issue or question. Please show the expected outcome based on the sample data you provided.
Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Hi rajasekaro
Since Company is on Columns, visual-level filtering alone is NOT enough.
You must control the measure value returned per company.
Step 1: Base measure (example)
Assume you already have something like:
Amount :=
SUM ( 'Fact'[Amount] )
Step 2: Currency-based visibility measure
Create a new measure:
Amount (Currency Rule) :=
VAR curr = SELECTEDVALUE ( 'Currency'[Currency] )
VAR comp = SELECTEDVALUE ( 'Company'[Company] )
RETURN
SWITCH(
TRUE(),
-- INR → only company 00030
curr = "INR" && comp = "00030",
[Amount],
-- USD → all except 00030
curr = "USD" && comp <> "00030",
[Amount],
-- hide everything else
BLANK()
)
Step 3: Use this measure in the Matrix
- Replace Amount with Amount (Currency Rule) in Values
- Matrix settings:
- Format → Values → Show items with no data = OFF
- Format → Columns → Stepped layout = OFF (optional, cleaner)
Result
|
Currency |
Visible Company Columns |
|
INR |
00030 only |
|
USD |
00000, 00020, 00040, 00050 (00030 hidden) |
Power BI automatically removes matrix columns that return only BLANK().
Important Notes
- Currency slicer must be single-select (radio button = perfect)
- Company slicer can stay All
- This works even with Totals and hierarchies
Optional: Keep Total Correct
If your Total is wrong (common issue), use:
Amount (Currency Rule) :=
VAR curr = SELECTEDVALUE ( 'Currency'[Currency] )
RETURN
SUMX(
VALUES ( 'Company'[Company] ),
VAR comp = 'Company'[Company]
RETURN
SWITCH(
TRUE(),
curr = "INR" && comp = "00030", [Amount],
curr = "USD" && comp <> "00030", [Amount],
BLANK()
)
)
If you want:
- Company slicer to auto-change
- Currency coming from fact rows
- RLS version
- Performance-optimized version for large data
tell me which one and I’ll tailor it.
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!
I have create A measure
(Currency Rule) =
VAR curr =
SELECTEDVALUE ( 'Currency selection'[Currency] )
VAR comp =
SELECTEDVALUE ( 'COMPANYMASTER'[COMPANYMASTERID] )
RETURN
SWITCH (
TRUE(),
-- INR → only company 00030
curr = "INR" && comp = "00030",
[Final Amount ],
-- USD → all except 00030
curr = "USD" && comp <> "00030",
[Final Amount ],
-- show 0 for all other cases
0
)
its also showing all column
- v-hashadapu7 months ago
Community Support
Hi rajasekaro , Thank you for reaching out to the Microsoft Community Forum.
Please try:
Currency Rule :=VAR curr =
SELECTEDVALUE ( 'Currency selection'[Currency] )
VAR comp =
SELECTEDVALUE ( 'COMPANYMASTER'[COMPANYMASTERID] )
RETURN
SWITCH (
TRUE(),
curr = "INR" && comp = "00030", [Final Amount],
curr = "USD" && comp <> "00030", [Final Amount],
BLANK()
)
If it didn’t give expected output, please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot). Include all the necessary details, detailing your scenario and issue as clearly and fully as possible.
Do not include sensitive information. Do not include anything that is unrelated to the issue or question. Please show the expected outcome based on the sample data you provided.
Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...