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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
atult
Advocate I
Advocate I

Different value at granular level and aggregated level

Hello experts,
We have data at manufacturer and keyword level. I require Share of search(SOS) and weighted share of search(Wtd SOS) which i have successfully calculated.

Where I’m facing issue is i need to show the calculated Wtd SOS at keyword level whereas need to show SUM(Wtd SOS) / SUM(Weights) at aggregated level.

Can someone please help me with the DAX so that i can achieve the above in a single calculated measure?

 

Data and Expected output (Light green cells at keyword level whereas dark green cell value in aggregated view in card/bar/line):

atult_0-1700746438837.png

 

Data in table:

ManufacturerKeywordValueWeights
MW1abc100.01
MW1xyz200.02
MW2pqr300.03
MW2def400.07

 

@amitchandak , @lbendlin , @Ritaf1983 , @Ahmedx , @Idrissshatila , @parry2k 

 

1 ACCEPTED SOLUTION
v-binbinyu-msft
Community Support
Community Support

Hi @atult ,

Please try to create measure with below dax formula:

Measure =
VAR _a =
    SELECTEDVALUE ( 'Table'[Weights] )
VAR _b =
    SELECTEDVALUE ( 'Table'[SOS] )
VAR _c = _a * _b
RETURN
    _c
Measure2 =
VAR _a =
    SUMX ( 'Table', [Weights] )
VAR _b =
    SUMX ( 'Table', [Measure] )
RETURN
    IF ( ISINSCOPE ( 'Table'[Manufacturer] ), _b, DIVIDE ( _b, _a ) )

 

Add a table visual with fields and measure:

vbinbinyumsft_0-1701326233688.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
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
v-binbinyu-msft
Community Support
Community Support

Hi @atult ,

Please try to create measure with below dax formula:

Measure =
VAR _a =
    SELECTEDVALUE ( 'Table'[Weights] )
VAR _b =
    SELECTEDVALUE ( 'Table'[SOS] )
VAR _c = _a * _b
RETURN
    _c
Measure2 =
VAR _a =
    SUMX ( 'Table', [Weights] )
VAR _b =
    SUMX ( 'Table', [Measure] )
RETURN
    IF ( ISINSCOPE ( 'Table'[Manufacturer] ), _b, DIVIDE ( _b, _a ) )

 

Add a table visual with fields and measure:

vbinbinyumsft_0-1701326233688.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

parry2k
Super User
Super User

@atult here is the link to the videos:

Let's explore the underrated ISINSCOPE DAX function - What is it? How we can use it? - YouTube

 

ISINSCOPE & ISFILTERED DAX functions give the same result-learn why use one over another- Power BI -...

 

Improve matrix visual by using calculation groups, conditional formatting, and ISINSCOPE - Power BI ...

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

I have few videos in this function on my YouTube channel - YouTube.com/@PowerBIHowTo



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@atult @You can use isinscope function to control the calculation. 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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