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
Giadev
Frequent Visitor

Visual chart or table with one fixed value and other from slicer

Hi,

I need to create some visuals (both chart and table) with one fixet value and other from a slicer...

TABLE  
DateAccountValue
01/01/2021A2435
01/01/2021B243
01/01/2021C541
02/02/2021A11656
02/02/2021B653
02/02/2021C890

 

SLICER
A
B

A is selected and C in hidden (filtered ount in slicer)

VISUAL TABLE 
44197A2435
44197C541
44229A11656
44229C890

 

Any ideas?

 

Thanks

1 ACCEPTED SOLUTION
DataZoe
Employee
Employee

@Giadev A solution for this is to create an Accounts table without the fixed one, then set up an inactive relationship to the Accounts table. A measure then can bring in the fixed account value and the selected account value.

 

Accounts Slicer table:

Account Slicer = SUMMARIZE(filter('Table','Table'[Account]<>"C"),'Table'[Account])
 
Model:
 
DataZoe_1-1614391140982.png

 

 

Measure:

Measure = CALCULATE(sum('Table'[Value]),USERELATIONSHIP('Account Slicer'[Account],'Table'[Account]))+CALCULATE(sum('Table'[Value]),filter('Table','Table'[Account]="C"))
 
Then use the Measure and Accounts from first table in your visual:
DataZoe_2-1614391154930.png

 

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

View solution in original post

4 REPLIES 4
DataZoe
Employee
Employee

@Giadev A solution for this is to create an Accounts table without the fixed one, then set up an inactive relationship to the Accounts table. A measure then can bring in the fixed account value and the selected account value.

 

Accounts Slicer table:

Account Slicer = SUMMARIZE(filter('Table','Table'[Account]<>"C"),'Table'[Account])
 
Model:
 
DataZoe_1-1614391140982.png

 

 

Measure:

Measure = CALCULATE(sum('Table'[Value]),USERELATIONSHIP('Account Slicer'[Account],'Table'[Account]))+CALCULATE(sum('Table'[Value]),filter('Table','Table'[Account]="C"))
 
Then use the Measure and Accounts from first table in your visual:
DataZoe_2-1614391154930.png

 

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

thank you, that's a good solution. is there a way to show C even if you don't select anything in the slicer?

Giadev
Frequent Visitor

resolved

 

Measure =
CALCULATE(
IF(SELECTEDVALUE('Account Slicer'[Account])=BLANK(),
CALCULATE(sum('Table'[Value]),FILTER('Table','Table'[Account]="C")),
CALCULATE(sum('Table'[Value]),USERELATIONSHIP('Account Slicer'[Account],'Table'[Account]))+CALCULATE(sum('Table'[Value]),FILTER('Table','Table'[Account]="C"))))

@Giadev Yes, perfect!  

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

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.

Top Solution Authors