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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
fabconmvp
Helper I
Helper I

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
Solution Sage
Solution Sage

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
― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978

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
Solution Sage
Solution Sage

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
― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978

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
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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