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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Compare dates based on values

Hello! I am fairly new to PowerBI but loving it so far but I am alittle stuck on something. I would like to setup a stacked area chart (or any other chart) which will compare dates where there is rain vs no rain recorded and display the COUNT of visitors based on those dates. Any help or guidance will be greatly appreciated! 

 

CountCountRainRain

 

 

 

7 REPLIES 7
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

Here's my data model:

y4.PNG

In the Weather table , I created a calculated column:

 

Number of visiter = 
CALCULATE(
    MAX('Count'[Count])
)

 

Then, I created the visualization:

y6.PNG

 

Best regards,
Lionel Chen

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

Anonymous
Not applicable

Hi @v-lionel-msft thanks for the replay and help! I followed your steps but for some reason I am getting the same SUM amount for both RAIN and NO RAIN in my graphs. I noticed your date format is different than mine, not sure if that matters. Also note that one day could have rain in the morning but not at night so the same day could have a 0.00 amount recorded. Any ideas?

 

 rainvistorcount.PNG

Hi @Anonymous ,

 

My model is as follows:

z6.PNGz7.PNGz8.PNG

Is your data model the same as mine? In other words, are the two tables a 1: * relationship?

For example, let ’s say 1/1/2020 at 4 am, 8 am without rain, and 2 pm with rain, and the number of visitors on that day is 100. Is this true?

If yes, you can do like this:

First, Ctrl+left-click to choose [Date] column and [Rain Validation] column, then, "Remve Duplicate rows":

z9.PNG

Second, create a calculated coumn in weather table:

Number = 
CALCULATE(
    MAX('Count'[Count]),
    ALLEXCEPT(
        'Count',
        'Count'[Date]
    )
)

Third, create visual:

z10.PNG

 

Best regards,
Lionel Chen

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

Anonymous
Not applicable

Hey @v-lionel-msft 

 

So I have a separate DATE table which I use in my data model but when I tried to directly connect weather to COUNT it can only be set as many-to-many relationship mainly because there many duplicate dates in both, you can download my datasets in my previous posts, appreciate your time in helping! 

 

tables.PNGraindaterelation.PNG

Hi @Anonymous ,

 

It is not necessary to establish a common date table, and directly establish a many-to-many relationship between the two tables, and then calculate.

 

Best regards,
Lionel Chen

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

amitchandak
Super User
Super User

What is the output you want?

 

Can you share source data in table format

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Well the output would be to find dates that have Rain/No Rain and match it to the COUNTS of visitors so I can compare.  

 

COUNTS TABLE 

https://drive.google.com/file/d/1kgWqxVabtGhLvmhq3u-rigbnrOqQ3vjT/view?usp=sharing 

 

WEATHER TABLE

https://drive.google.com/file/d/103I6N7G5C-GU-zFa5qyx-v-ZM6LPHUzq/view?usp=sharing 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors