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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Meca2u
New Member

Tricky measure with dax

Hi

I have the following table, with a filter on date at the top.

Meca2u_0-1705470568583.png

I am trying to create a measure in Power BI Desktop called Denominator that will return something like this...

Meca2u_1-1705470894756.png

So basically i want to return the Value from the Minimum Period against Country, State and Colour and put it against all rows for each Country, State and Colour combination.

 

Any ideas?

 

1 ACCEPTED SOLUTION
Meca2u
New Member

Thanks,

Below the dax i was looking for....

 

Denominator =
var _min_period=
MINX(
    FILTER(ALLSELECTED('Query1'),Query1[Country] = MAX(Query1[Country]) && Query1[State] = MAX(Query1[State]) && Query1[Colour] = MAX(Query1[Colour]) ),
    'Query1'[Period])

var _min_value=
MINX(
    FILTER(ALLSELECTED('Query1'),Query1[Country] = MAX(Query1[Country])  && Query1[State] = MAX(Query1[State]) && Query1[Colour] = MAX(Query1[Colour]) && Query1[Period]=_min_period),[Value])

RETURN _min_value

View solution in original post

3 REPLIES 3
Meca2u
New Member

Thanks,

Below the dax i was looking for....

 

Denominator =
var _min_period=
MINX(
    FILTER(ALLSELECTED('Query1'),Query1[Country] = MAX(Query1[Country]) && Query1[State] = MAX(Query1[State]) && Query1[Colour] = MAX(Query1[Colour]) ),
    'Query1'[Period])

var _min_value=
MINX(
    FILTER(ALLSELECTED('Query1'),Query1[Country] = MAX(Query1[Country])  && Query1[State] = MAX(Query1[State]) && Query1[Colour] = MAX(Query1[Colour]) && Query1[Period]=_min_period),[Value])

RETURN _min_value
Anonymous
Not applicable

Hi @Meca2u  ,

 

Please follow these steps:

1.Create metrics that return the smallest value for the smallest date after sorting by country, state, and color.

 

Denominator = 
var _min_period=
MINX(
    FILTER(ALLSELECTED('Table'),'Table'[Country] = MAX('Table'[Country]) && 'Table'[State] = MAX('Table'[State]) && 'Table'[Colour] = MAX('Table'[Colour])),
    'Table'[Period])
var _min_value=
MINX(
    FILTER(ALLSELECTED('Table'),'Table'[Country] = MAX('Table'[Country]) && 'Table'[State] = MAX('Table'[State]) &&'Table'[Period]=_min_period),[Value])
return
IF(
    MAX('Table'[Period])=_min_period&&MAX('Table'[Value])=_min_value,_min_value,BLANK())

 

2.The results obtained are as follows.

vkaiyuemsft_1-1705481715987.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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

pratyashasamal
Memorable Member
Memorable Member

Hi @Meca2u ,

You can this calculation :-

Column = CALCULATE(MIN(Table1[Value]),FILTER(Table1,Table1[Country]=EARLIER(Table1[Country]) && Table1[State] =EARLIER(Table1[State]) && Table1[Color] =EARLIER(Table1[Color]))))

Thanks,
Pratyasha Samal
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C





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

Proud to be a Super User!





Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors