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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
fabconmvp
Frequent Visitor

DAX Help

Hello everyone,


I need help about dax. First of all ı have a table visualization in PBI. And below the image is example of how PBI visualization. I have 2 table. 1 Fact table and other DimDate table. There is a 1(dimdate) to many(fact) based on Date. Weeks and Date comes from DimDate table. Value is a measure which is SUM(Fact[Value]). and I want to create a measure which gives max value for SUM(Fact[Value]) based on weeks and lastly ı have some slicers that needs to effected. So whenever slicer changes max value needs to be effected.

Fact Table:

fabconmvp_1-1740837671249.png

 

The table I visualized in PBI:

fabconmvp_0-1740681963123.png

 


Thanks for supports.

1 ACCEPTED SOLUTION
techies
Resolver I
Resolver I

Hi @fabconmvp 

Please check this

Max_Weekly_Value_Per_Week =
VAR CurrentWeek = SELECTEDVALUE('date'[Week])
VAR WeeklyValues =
    CALCULATETABLE(
        SUMMARIZE(
            Sheet2,
            'date'[Week],
            Sheet2[Value]
        ),
        ALLEXCEPT('date', 'date'[Week])
    )

RETURN
    MAXX(FILTER(WeeklyValues, 'date'[Week] = CurrentWeek), [Value])jh.png

View solution in original post

11 REPLIES 11
Ashish_Mathur
Super User
Super User

Hi,

Try this measure

=MAXX(ALLSELECTED(Calendar[weeks]),[Value])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hello,

İt doesn't work. The values doesn't change. Thank you for support.

You are welcome.  Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
techies
Resolver I
Resolver I

Hi @fabconmvp 

Please check this

Max_Weekly_Value_Per_Week =
VAR CurrentWeek = SELECTEDVALUE('date'[Week])
VAR WeeklyValues =
    CALCULATETABLE(
        SUMMARIZE(
            Sheet2,
            'date'[Week],
            Sheet2[Value]
        ),
        ALLEXCEPT('date', 'date'[Week])
    )

RETURN
    MAXX(FILTER(WeeklyValues, 'date'[Week] = CurrentWeek), [Value])jh.png

Hello,

 

Firstly, thank you for support. I guess some of the column missing but I modified it in your measure. I'm testing detailly right now that effected other slicers etc. I'm going to accept accept the solution if ı have no question. Thank you for support.
"

test =
VAR CurrentWeek = SELECTEDVALUE(DimDate[WeekNum])
VAR WeeklyValues =
    CALCULATETABLE(
        SUMMARIZE(
            'Fact',
            DimDate[Date],
            DimDate[WeekNum],
            "Value",
            SUM('Fact'[value])
        ),
        ALLEXCEPT(DimDate, DimDate[WeekNum])
    )

RETURN
    MAXX(FILTER(WeeklyValues, DimDate[WeekNum] = CurrentWeek),[Value])
"
 
anmolmalviya05
Super User
Super User

Hi @fabconmvp, Hope you are doing good,

Please try the below measure:

Max Value per Week =
MAXX(
VALUES(DimDate[Week]),
CALCULATE( SUM(Fact[Value]) )
)
If this post helps to answer your question, please consider accepting it as a solution so others can find it more quickly when they face a similar challenge.


Proud to be a Microsoft Fabric community super user


Let's Connect on LinkedIn

Subscribe to my YouTube channel for Microsoft Fabric and Power BI updates.

Hello,

 

Thank you for support. However, it didnt work. The values shown as in the first image. 

johnt75
Super User
Super User

I think you can use

Max Value =
MAXX ( ALLSELECTED ( 'DimDate'[Week] ), [Value] )

Hello,

 

Thank you for support. However, it didnt work. The values shown as in the first image. 

Is your DimDate table marked as a date table ?

Hello,

 

Yes marked as a date.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.