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
bodnaran
Regular Visitor

Conditional format based on coverage date

Hello guys,

 

I am struggling for a while to reproduce an excel type matrix in Power BI.

 

bodnaran_0-1694002116678.png

The input from the users is not comming every day, it is made once a week.

I have a date table which is covering the whole year (01.01.2023 -31.12.2023). In this table I have the following columns:

bodnaran_1-1694002276675.png

 

My facts table is like below:

 

CoverageDay of Year for CoverageDay of Year for TodayProject_nameCustomer_namePlant_nameInt_extUpdate_dateWeek of YearPlant IDCustomer IDProject ID
29-09-2023272249111123Ext05-09-2023362512
08-09-2023251249222234Ext05-09-2023362511
18-09-2023261249333345Ext04-09-2023364715
26-09-2023269249444456Int04-09-202336122
26-09-2023269249555567Int04-09-202336127
26-09-2023269249666678Ext04-09-202336139
08-09-2023251249777789Int04-09-202336124
08-09-2023251249888900Int04-09-202336125
24-10-20232972499991011Int04-09-202336126
07-11-2023311249101101122Int04-09-202336128
27-11-2023331249111211233Int04-09-202336149
29-09-2023272249121321344Ext04-09-2023361310
07-09-2023250249131431455Ext04-09-2023363513
18-09-2023261249141541566Ext04-09-2023364614
28-11-2023332249151651677Int04-09-202336111
27-10-2023300249161761788Int04-09-202336145
11-09-2023254249171871899Ext04-09-2023364816
02-10-2023275249181982010Int28-08-202335123

 

In the end I need a matrix which needs to look like the "excel" example above. I tried to use some function that shows me the "green" until the coverage day but I get red only on the day of coverage like below:

 

bodnaran_2-1694002677507.png

DAX codes I tried

 

 

IsAllSmaller = 
IF (
    COUNTROWS (
        FILTER (
            F_CustomerUpdate,
            F_CustomerUpdate[Day of Year for Coverage]
                >= MAX ( F_CustomerUpdate[Day of Year])
        )
    )=0,
    "Green",
    "Red"
)

 

 

 

 

Test = 
SWITCH(
    TRUE(),
    SELECTEDVALUE(F_CustomerUpdate[Day of Year for Coverage])=BLANK(),0,
    SELECTEDVALUE(F_CustomerUpdate[Day of Year for Coverage]) > SELECTEDVALUE(F_CustomerUpdate[Day of Year]), 1 , 
    SELECTEDVALUE(F_CustomerUpdate[Day of Year for Coverage]) )

 

 

Any idea how can I show Green until the coverage day and red after the coverage day?

0 REPLIES 0

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.