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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
annamakarova
New Member

After filtering in A choose min sales per ID in B and summarize them

Hello!
I have dataset with product IDs, competitors and sales.
In Power BI I need to make like "dynamic recalculation" after user choose competitors.

annamakarova_0-1623888220568.png

1. User choose competitors (a & c);

2. Need to find minimum sales per IDs (for ID 1 it will be 12, for ID 2 - 2);

3. Then summarize found sales (12 + 2).


The problem is that I understand how  to do it for constant dataset (for all competitors) with SQL, Python, but how to make it recalculated depends on competitor's choose?

Appreciate any help, as I am newcomer in Power BI world...

 

Anna

1 ACCEPTED SOLUTION

Hi, @annamakarova 

Please check the below.

 

Picture1.png

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi, @annamakarova 

Please check the below picture and the sample pbix file's link down below.

 

Picture2.png

 

Result Measure =
VAR groupbyIDtable =
GROUPBY (
ALLSELECTED ( Data ),
Data[ID],
"@minsales",
MINX (
CURRENTGROUP (),
Data[sales]
)
)
RETURN
SUMX (
groupbyIDtable,
[@minsales]
)
 
 
 
 
 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Dear @Jihwan_Kim , thanks a lot!

But how to make it works for different categories?
So in Result Measure there is total sum of minimum sales per ID is shown for category A, B, C separately?

annamakarova_0-1623912507527.png

 

Hi, @annamakarova 

Please check the below.

 

Picture1.png

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors