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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
test101
New Member

Issue with DAX: getting a score for a team in a specific week.

Hi fellow Power BI enthousiasts,

 

Introduction

I'm working a power BI dashboard that monitors the performance of teams on different scores for every week for an organisation I'm working for.

 

Data

At unregelar moments I receive new data for a specfic week for all teams. This can be once a month, but also twice. The below table displays the data I'm receiving:

Account Project      CommentWeeknumber GeneralScore*
AProject AGood performance23
AProject BWorking hard21
BProject CGetting better18
BProject D Not yet on full capacity 16

* GeneralScore is a score of team performance that is 1, 2, or 3. 

 

I want to display this data in the following table in PBI:

Account Project      CommentWeeknumber  GeneralScoreT-2**
AProject AGood performance23
AProject BWorking hard21
BProject CGetting better1***
BProject D Not yet on full capacity 1***

 

Issue

** Is the GeneralScore of a team on CURRENTWEEK-2. So currently we are in week 4, which will means that the column is displaying the GeneralScores for all teams on week 2.

***If there is no data on CURRENTWEEK-2 for an project, it is important the the row is still displayed, only that cel is then empty.

 

I tried to create different DAX measures to get this working. However, I'm having issues with the rows that have no data for a specific week, they are not displayed in the table. 

 

DAX measure that I tried

Option 1

 

 

General-2 = 
CALCULATE (
    MAX ( 'Delivery data'[GeneralScore] ),
    ALLEXCEPT ( 'table', 
    'Delivery data'[Account],
    'Delivery data'[Project],
    'Delivery data'[Comment]),
    'Delivery data'[Weeknumber] = WEEKNUM(TODAY(), 21) -2
)

 

 

Option 2

 

 

General-2 = 
CALCULATE (
    MAX( 'table'[GeneralScore] ),
    ALLEXCEPT ( 'table', 'table'[Project]),
    'table'[Weeknumber] = WEEKNUM(TODAY(), 21) - 2
)

 

 

Both options have the same issue: no rows are displayed if there is no data on week CURRENTWEEK-2 for a team. 

 

Could some please help with this issue? I'm really curious what I'm doing wrong. Please let me know if you need additional information.

 

Thanks in advance!

1 REPLY 1
ERD
Community Champion
Community Champion

Hi @test101 ,

You can use Show items with no data feature: Show items with no data in Power BI - Power BI | Microsoft Learn

 

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

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.