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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SwaroopRoyM
Helper II
Helper II

Data Formatting and Parameterized report

Hi,

 

I have a filter (both page level/report level) in my report (pbix). my requirement is to display data in visuals based on the selection made. The issue here is i've to get the data from separate tables based on the selection made.

 

For example: in my Filter i've 2 values t1, t2. If i select t1, then the data should be from table1, if t2 then the data should be from table2.

 

Is this possible in Power BI? If yes, how to achieve this?

 

Thanks,

Swaroop

1 REPLY 1
Michiel
Resolver III
Resolver III

If you have filter values t1 and t2, you'll have a table in your model that contains these values. When you add a column to this table with a number value (I always use powers of 2 for this, so in this case 1 and 2), it is possible to detect the value selected by evaluating the sum of the number value, e.g. SUM(Selection[Code]).

Taking data from one or the other table is a matter of creating multiple measures, e.g.

Result1 = SUM(Table1[Value])

Result2 = SUM(Table2[Value])

 

The measure to be used in the report can select on of these using SWITCH:

Result = SWITCH(SUM(Selection[Code]), 1, [Result1], 2, [Result2])

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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