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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
niyaz006
Frequent Visitor

DAX to show same value for missing months

My data

CategorySub categoryDateValue
Cat1Subcat11-Jan1
Cat1Subcat21-Jan1
Cat2Subcat31-Jan1
Cat2Subcat41-Jan1
Cat1Subcat11-Feb2
Cat1Subcat21-Mar2
Cat2Subcat41-Mar3

 

The value ranges from 1 to 5. I am looking to create a table like below

 

Month#Value 1s#Value 2s#Value 3s# Value 4s# Value 5s
1-Jan40000
1-Feb31000
1-Mar1(1+1)

1

00

 

In Feb, 1 entry's has value changed to 2. Hence, that row from the previous month is ignored, but every other record (3 x 1s) is counted

I tried something like the below:

 

Cumulative Value Count = 
CALCULATE(
    COUNTROWS(SUMMARIZE(Table, [Cat], [Subcat])),
    FILTER(ALL(Table[date]), 
        Table[startdate] <= MAX(Table[date])
        )
    )

 

 But my output was (it is not reducing the value 1s when they have moved to 2s and 3s, ....

Month#Value 1s#Value 2s#Value 3s# Value 4s# Value 5s
1-Jan40000
1-Feb41000
1-Mar4100

 

Any help/guidance?

2 REPLIES 2
VahidDM
Super User
Super User

Hi @niyaz006 

 

can you please add more details about the output? what are those values1 to values 5 in the table? 

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 

The value column can have values from the range (1 to 5). These are like levels. Level 1 to 5. The Level might increase from 1 to 2 in a month or 2 or even more. Lets say a metric Category 1 and Subcategory1 is Level 1 in Jan. We will get this data. The next time we get the data is when it changes to Level 2. Lets say it happens in March. So I need to show Level 1 in Jan and Feb. And Level 2 from March.

 

In the output table, I am summarising how many metrics are in level 1 to level 5 in each month.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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