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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Julier
Helper III
Helper III

formula

I am looking for a formula to return a vol that matches the date 01/08/25 and the ID BEL_14667/0 from the table below when forecast A matches forecast b

 BEL_14667/0  
01/08/2025#NAME?  
    
    
IDforecast Aforecast bVol
BEL_14667/001/07/202501/07/2025                232,932
BEL_14667/001/07/202501/08/2025                195,613
BEL_14667/001/07/202501/09/2025                239,887
BEL_14667/001/07/202501/10/2025                294,476
BEL_14667/001/07/202501/11/2025                327,610
BEL_14667/001/07/202501/12/2025                149,035
BEL_14667/001/08/202501/08/2025                220,000
BEL_14667/001/08/202501/09/2025                239,887
BEL_14667/001/08/202501/10/2025                294,476
2 ACCEPTED SOLUTIONS
grazitti_sapna
Super User
Super User

Hi @Julier,

 

Try below DAX:-

 

Vol_Match =
CALCULATE(
MAX(Table[Vol]),
Table[ID] = "BEL_14667/0",
Table[forecast A] = Table[forecast b],
Table[forecast b] = DATE(2025,8,1)
)

 

🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
🔗 Curious to explore more? [Discover here].
Let’s keep building smarter solutions together!

View solution in original post

AmiraBedh
Super User
Super User

Hello !

Thank you for posting on Fabric community.

You can filter the table to just the rows where ID = BEL_14667/0 and forecastA = forecastB = #date(2025,8,1)
and from that filtered table, take the first match vol value if no row matches return null.

= let
    Source =
        #table(
            type table [ID = text, forecastA = date, forecastB = date, Vol = number],
            {
                {"BEL_14667/0", #date(2025, 7, 1), #date(2025, 7, 1), 232932},
                {"BEL_14667/0", #date(2025, 7, 1), #date(2025, 8, 1), 195613},
                {"BEL_14667/0", #date(2025, 7, 1), #date(2025, 9, 1), 239887},
                {"BEL_14667/0", #date(2025,10, 1), #date(2025,10, 1), 294476},
                {"BEL_14667/0", #date(2025,11, 1), #date(2025,11, 1), 327610},
                {"BEL_14667/0", #date(2025,12, 1), #date(2025,12, 1), 149035},
                {"BEL_14667/0", #date(2025, 8, 1), #date(2025, 8, 1), 220000},
                {"BEL_14667/0", #date(2025, 8, 1), #date(2025, 9, 1), 239887},
                {"BEL_14667/0", #date(2025, 8, 1), #date(2025,10, 1), 294476}
            }
        ),

    TargetID   = "BEL_14667/0",
    TargetDate = #date(2025, 8, 1),

    Filtered = Table.SelectRows(
        Source,
        each [ID] = TargetID and [forecastA] = TargetDate and [forecastB] = TargetDate
    ),

    ResultVol = if Table.IsEmpty(Filtered) then null else Filtered{0}[Vol]
in
    ResultVol

 

AmiraBedh_0-1759324153983.png

you can find the solution in the pbix file.

 


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

View solution in original post

3 REPLIES 3
V-yubandi-msft
Community Support
Community Support

Hi @Julier ,

I wanted to check if you had the opportunity to review the information provided by @AmiraBedh,  @grazitti_sapna . Please feel free to contact us if you have any further questions. 
 

Thank you and continue using Microsoft Fabric Community Forum.

AmiraBedh
Super User
Super User

Hello !

Thank you for posting on Fabric community.

You can filter the table to just the rows where ID = BEL_14667/0 and forecastA = forecastB = #date(2025,8,1)
and from that filtered table, take the first match vol value if no row matches return null.

= let
    Source =
        #table(
            type table [ID = text, forecastA = date, forecastB = date, Vol = number],
            {
                {"BEL_14667/0", #date(2025, 7, 1), #date(2025, 7, 1), 232932},
                {"BEL_14667/0", #date(2025, 7, 1), #date(2025, 8, 1), 195613},
                {"BEL_14667/0", #date(2025, 7, 1), #date(2025, 9, 1), 239887},
                {"BEL_14667/0", #date(2025,10, 1), #date(2025,10, 1), 294476},
                {"BEL_14667/0", #date(2025,11, 1), #date(2025,11, 1), 327610},
                {"BEL_14667/0", #date(2025,12, 1), #date(2025,12, 1), 149035},
                {"BEL_14667/0", #date(2025, 8, 1), #date(2025, 8, 1), 220000},
                {"BEL_14667/0", #date(2025, 8, 1), #date(2025, 9, 1), 239887},
                {"BEL_14667/0", #date(2025, 8, 1), #date(2025,10, 1), 294476}
            }
        ),

    TargetID   = "BEL_14667/0",
    TargetDate = #date(2025, 8, 1),

    Filtered = Table.SelectRows(
        Source,
        each [ID] = TargetID and [forecastA] = TargetDate and [forecastB] = TargetDate
    ),

    ResultVol = if Table.IsEmpty(Filtered) then null else Filtered{0}[Vol]
in
    ResultVol

 

AmiraBedh_0-1759324153983.png

you can find the solution in the pbix file.

 


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696
grazitti_sapna
Super User
Super User

Hi @Julier,

 

Try below DAX:-

 

Vol_Match =
CALCULATE(
MAX(Table[Vol]),
Table[ID] = "BEL_14667/0",
Table[forecast A] = Table[forecast b],
Table[forecast b] = DATE(2025,8,1)
)

 

🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
🔗 Curious to explore more? [Discover here].
Let’s keep building smarter solutions together!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.