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

Measure to get a value exactly as shown in a card visual?

Apologies for posting this so soon after a previous post, but hoping this can be cleared up quickly.

 

I have a card visual that counts the total in a table. However, this total has filters applied to it using slicers. I'd like a measure that gets the exact value shown in this card visual without entering all the slicer filters inside the DAX expression again. Is this possible?

 

Thanks!

1 ACCEPTED SOLUTION

Hi @mmh9119 ,

Please try the following methods and check if they can solve your problem:

1.Create the simple tables.

vjiewumsft_0-1708327140061.png

2.Create the new measure to calculate. Drag the measure into the Visual A.

vjiewumsft_1-1708327165826.png

3.Select Broken Nation and CIC in the slicer.

vjiewumsft_4-1708327330166.png

 

vjiewumsft_2-1708327173958.png

4.Select Edit interactions in the format pane.

vjiewumsft_3-1708327184383.png

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

4 REPLIES 4
mmh9119
Frequent Visitor

Thanks for the replies. I will try and be more clear.

 

I have the following:

mmh9119_1-1707836112024.png

 

Visual A is a card visual containing a measure for the percentage of values for a specific value type (AgeUnder12) in a table. The measure has the following DAX:

 

_Perc_AgeUndr12 = 
DIVIDE (
CALCULATE (
COUNTROWS ( Table1 ),
FILTER ( ALLSELECTED ( Table1 ), Table1[AgeUnder12] = "Y" )
),
COUNT ( Table1[PersonId] ),
1 //0 -- Add a default value for divide to handle potential division by zero
)

 

 

On the bottom are two filters. If any item in either of the two filters are selected, the value in Visual A changes accordingly. What I want is that after I have set the two filters ("Brokenhead Ojibway Nation" and "CIC"), I want a different measure (call it "_Visual_A_Measure") to directly get the resulting total count in visual A.

Something like:

 

_Visual_A_Measure = GETVALUE(Visual A i.e. the value in the card visual)

 


@v-jiewu-msft I can't use the sum method because that's not how the value is being calculated unfortunately. Alternatively, if the above is not doable, I'm wondering if you could help me with applying the filters into the DAX expression instead. I have the following:

 

_REP_Global_UnderAge12_Perc = 
DIVIDE (
CALCULATE (
COUNTROWS ( Table1 ),
FILTER ( ALL( Table1 ), Table1[AgeUnder12] = "Y" ),
FILTER(ALL(Table1), Table1[FirstNationName] = "Brokenhead Ojibway Nation"),
FILTER(ALL(Table1), Table1[CaseCat] = "CIC")
),
COUNT ( Table1[PersonId] ),
1 //0 -- Add a default value for divide to handle potential division by zero
)

 


However, this gives me a value of 0.01 instead of 0.58 like in the card visual A. I don't see what the issue might be?

Thanks!

Hi @mmh9119 ,

Please try the following methods and check if they can solve your problem:

1.Create the simple tables.

vjiewumsft_0-1708327140061.png

2.Create the new measure to calculate. Drag the measure into the Visual A.

vjiewumsft_1-1708327165826.png

3.Select Broken Nation and CIC in the slicer.

vjiewumsft_4-1708327330166.png

 

vjiewumsft_2-1708327173958.png

4.Select Edit interactions in the format pane.

vjiewumsft_3-1708327184383.png

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

v-jiewu-msft
Community Support
Community Support

Hi @mmh9119 ,

Please try the following methods and check if they can solve your problem:

1.Create the simple table.

vjiewumsft_0-1707805699261.png

2.Select the slicer visual and drag the name into the slicer.

vjiewumsft_1-1707805711657.png

3.Create a new measure to calculate total. Enter the following DAX formula.

Total = SUM('Table'[Margin])

 

4.Select the new card visual. Drag the measure to the visual.

 

5.In the Format pane, select Edit interaction. Click on the None.

vjiewumsft_2-1707805720043.png

 

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

Daniel29195
Super User
Super User

Hello @mmh9119 

sorry, but i ddint really get what you want. 

can you please share a presentation of the output you want to achieve ? 

 

 

best regards

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.