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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

issue with data model

Hi,

 

Is anybody there to help me. unable to resolve data model. i have attached the report

 

https://1drv.ms/u/s!ApPgrUdbr1NBb2-U9jy6VXx7j4I?e=w4KFN1

 

PAGE 2 I want to show my hour and day wise,

 

if you filter the DAY slicer on 28th my sales value should split by hour. currently i am getting same value for all hours in column metric.

 

same for the daywise , if i filter on  DAY slicer on 28th i should get only value for column metric.

 

Guys please help

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

This is the relationship you would like to use

 

image.png

But unfortunately your relationship is at DAY level. So your grouping by hour in your visuals won't change filtered rows on the Retail table, because all hours will refer to the same day, so your total hours is the total hours of the day. You should change the granularity of the relationship OR you can change your formula:

 

Select Sales = 
/*IF(
    SUM('Retail Pos'[netAmount])=BLANK();0;
    SUM('Retail Pos'[netAmount])
)*/
var val=SELECTEDVALUE('Select Date'[Hour])
var total=calculate(sumx('Retail Pos';'Retail Pos'[netAmount]);'Retail Pos'[Hour]=val)    
RETURN
if(isblank(total);0;total)

 

repeat the formula for all the other metrics. This is the result:

 

image.png

View solution in original post

Need separate date, hour and timestamp tables.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

This is the relationship you would like to use

 

image.png

But unfortunately your relationship is at DAY level. So your grouping by hour in your visuals won't change filtered rows on the Retail table, because all hours will refer to the same day, so your total hours is the total hours of the day. You should change the granularity of the relationship OR you can change your formula:

 

Select Sales = 
/*IF(
    SUM('Retail Pos'[netAmount])=BLANK();0;
    SUM('Retail Pos'[netAmount])
)*/
var val=SELECTEDVALUE('Select Date'[Hour])
var total=calculate(sumx('Retail Pos';'Retail Pos'[netAmount]);'Retail Pos'[Hour]=val)    
RETURN
if(isblank(total);0;total)

 

repeat the formula for all the other metrics. This is the result:

 

image.png

Anonymous
Not applicable

Sir, first of all thankyou for solving this out.

 

 , how can i  change the granularity of the relationship

 

i used you formula in bar chart its working for hour. but all other values were affected. and no data in day wise

 

 

Need separate date, hour and timestamp tables.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Create separate Hours and Date tables.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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