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
SandySharma
Resolver I
Resolver I

how to show default KPI value using DAX

HI Gurus,

 

I got stuck during the development of my dashboards in power BI. I am new to power BI , my query might be silly but I could not figureout how to do the same, that's why I am approaching Gurus here, so excue for the same.

 

Requirement: I have two Chart one Bar chart and second Card Chart. in Card chart I want to show default value of any dimension displayed in Bar chart by default instead aggregation of all.

 

Help.png

 

As you can see in above screen shot Card is showing aggreated value.

 

Requirement: Instead of all, I want to display the default value of first dimension visible in bar chart however user should be able to select any of dimension from Bar chart and value should be change accordingly.

 

Please help me how can I achieve the same in Power BI.

1 ACCEPTED SOLUTION

Hi MFelix,

 

My Requirement was littel different. If no interaction is happening then it Card should show the value of North Asia, If any ineraction happened on Bar Chart then it should show the selected value result in card from Bar chart.

 

After few hit and trail I am able to do the same by taking reference from DAX HASONEFILTER Function (DAX)

My Logic :

Measure 2 = IF(HASONEFILTER(Data[Geo]),ROUND( (SUM(Data[Market Growth])*100),1)&"%" &"("& FILTERS(Data[Geo])&")",
CALCULATE(ROUND( (SUM(Data[Market Growth])*100),1) &"% (North Asia)",Data[Geo]="North Asia"))

 

Default View.JPG

 

No interaction in above chart and able to show Default value of North Asia.

 

 

Interaction View.JPG

 

interaction happen on bar chart and selected DVM in above chart and able to show DVM Value.

 

Anyways thanks for your effort.

View solution in original post

2 REPLIES 2
MFelix
Super User
Super User

Hi @SandySharma,

 

I don't know how you are calculating the Numeric Market Growth but in my example I have made a simple table with Country and Values

 

Made a simple measure to calculate the % per country:

% Total =
MAXX (
    Table1,
    Table1[Values] / CALCULATE ( SUM ( Table1[Values] ), ALL ( Table1 ) )
)

 

MAXX.png

 

You need to wrap your measure in a MAXX formual something like this:

Number Market Share_Max = MAXX(Data,[Number Market Growth])

Should make the trick.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi MFelix,

 

My Requirement was littel different. If no interaction is happening then it Card should show the value of North Asia, If any ineraction happened on Bar Chart then it should show the selected value result in card from Bar chart.

 

After few hit and trail I am able to do the same by taking reference from DAX HASONEFILTER Function (DAX)

My Logic :

Measure 2 = IF(HASONEFILTER(Data[Geo]),ROUND( (SUM(Data[Market Growth])*100),1)&"%" &"("& FILTERS(Data[Geo])&")",
CALCULATE(ROUND( (SUM(Data[Market Growth])*100),1) &"% (North Asia)",Data[Geo]="North Asia"))

 

Default View.JPG

 

No interaction in above chart and able to show Default value of North Asia.

 

 

Interaction View.JPG

 

interaction happen on bar chart and selected DVM in above chart and able to show DVM Value.

 

Anyways thanks for your effort.

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.